profile
viewpoint

Ask questions"build constraints exclude all Go files in" when trying to import golang.org/x/sys/unix

What exactly did you do? Did you specify GOOS=js and GOARCH=wasm?

Originally posted by @neelance in https://github.com/golang/go/issues/26598#issuecomment-407818226

I saw this answer in an old issue but did not understand why this needs to be done

golang/go

Answer questions AlexRouSg

Please fill in the entire issue template you see when creating a new issue. What exactly are you trying to do? And what exactly is your build environment? (Output from the command go env)

Setting GOOS and/or GOARCH means you are cross compiling. golang.org/x/sys/unix as the name suggest, is a unix package and thus is only for Linux/OSX and other unix based operating systems. Your issue title suggest you are on windows, in which case you cannot use this package.

useful!
source:https://uonfu.com/
Github User Rank List