I am trying to compile some small Go application to WebAssembly using this command:
GOOS=js GOARCH=wasm go build .
My small app uses some function from 3rd party package that has dependency to golang.org/x/sys/unix that is not supposed to be complied for Web Assembly.
Even if my application does not use any functions from golang.org/x/sys/unix, I can not compile my code to WASM due to error:
imports golang.org/x/sys/unix: build constraints exclude all Go files in /some_path/vendor/golang.org/x/sys/unix
Are there any workarounds?
I tried to refactor the code to extract the functions that I need to another package without dependency to golang.org/x/sys/unix but it's not the easiest thing in this project.