From ba9f4adcf766b262d80e177c069f0d5097841bb1 Mon Sep 17 00:00:00 2001 From: Andrew Steurer <94206073+asteurer@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:07:54 -0500 Subject: [PATCH] feat: document how to use go vet Signed-off-by: Andrew Steurer <94206073+asteurer@users.noreply.github.com> --- examples/wasip1/README.md | 2 +- examples/wasip2/README.md | 14 +++++++++++++- examples/wasip3/README.md | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/wasip1/README.md b/examples/wasip1/README.md index 9691a3b..80c7ab4 100644 --- a/examples/wasip1/README.md +++ b/examples/wasip1/README.md @@ -4,7 +4,7 @@ ### Prerequisites -- [**componentize-go**](https://github.com/bytecodealliance/componentize-go) - v0.3.0 +- [**componentize-go**](https://github.com/bytecodealliance/componentize-go) - Latest version - [**go**](https://go.dev/dl/) - v1.25+ - [**wasmtime**](https://github.com/bytecodealliance/wasmtime) - v43.0.0 diff --git a/examples/wasip2/README.md b/examples/wasip2/README.md index 56d4736..9cf7df6 100644 --- a/examples/wasip2/README.md +++ b/examples/wasip2/README.md @@ -4,7 +4,7 @@ ### Prerequisites -- [**componentize-go**](https://github.com/bytecodealliance/componentize-go) - v0.3.0 +- [**componentize-go**](https://github.com/bytecodealliance/componentize-go) - Latest version - [**go**](https://go.dev/dl/) - v1.25+ - [**wasmtime**](https://github.com/bytecodealliance/wasmtime) - v43.0.0 @@ -28,3 +28,15 @@ make run-tests make generate-bindings go test ./unit_tests_should_pass ./unit_tests_should_fail ``` + +### Run `go vet` + +The generated code will fail the default `go vet` analysis due to: +- How `unsafe.Pointer` is used +- How the WIT tuple type is represented in Go + +If you must perform static analysis on the generated code, this is the workaround: + +```sh +go vet -unsafeptr=false -composites=false ./... +``` diff --git a/examples/wasip3/README.md b/examples/wasip3/README.md index 1dd6d5e..16f7f50 100644 --- a/examples/wasip3/README.md +++ b/examples/wasip3/README.md @@ -18,7 +18,7 @@ switch to the upstream releases. ### Prerequisites -- [**componentize-go**](https://github.com/bytecodealliance/componentize-go) - v0.3.0 +- [**componentize-go**](https://github.com/bytecodealliance/componentize-go) - Latest version - [**wasmtime**](https://github.com/bytecodealliance/wasmtime) - v43.0.0 ### Build and Run