tinygo
tinygo copied to clipboard
Error on tinygo wasip1 example on website
For this code:
package main
//go:wasmimport yourmodulename add
func add(x, y uint32) uint32 {
return x + y
}
// main is required for the `wasip1` target, even if it isn't used.
func main() {}
and running this command:
GOOS=wasip1 GOARCH=wasm tinygo build -o main.wasm main.go
results in:
main.go:4:6: can only use //go:wasmimport on declarations
Using tinygo 0.33
Edit: more info tinygo version 0.33.0 darwin/arm64 (using go version go1.22.2 and LLVM version 18.1.2)