Closed mattjohnsonpint closed 2 months ago
As far as I can tell from that screenshot, that error is reported to us either by go build
or by go/types
, Staticcheck is merely forwarding it. You'll have to make sure you're running the expected version of Staticcheck, built and running with the expected version of Go.
I've been using the workaround described in https://github.com/golangci/golangci-lint/issues/4956#issuecomment-2310719310
It works well, so I don't think there is anything else to do here. Thanks.
Any function tagged with
//go:wasmimport
(added in Go 1.21 and also TinyGo) should not have a body, yet staticcheck thinks that it needs one.See: https://go.dev/blog/wasi#wrapping-wasm-functions-in-go-with-gowasmimport
There's also an older syntax only supported by TinyGo, though I'd be happy with just the official syntax supported. See https://github.com/tinygo-org/tinygo/issues/4372
Checked with both 2023.1.7 and 2024.1rc1, with same results. I guess it just hasn't been added yet. Would be good to support before the 2024 version has its final release. Thanks.
Thanks.