Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aadarshpratik1 opened this issue Jun 11, 2019 · 2 comments

Comments

@aadarshpratik1
Copy link

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

Originally posted by @neelance in #26598 (comment)

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

@AlexRouSg
Copy link
Contributor

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.

@agnivade
Copy link
Contributor

If you do not specify GOOS and GOARCH, the build constraints won't pick up the right files for that target. Please see https://golang.org/pkg/go/build/#hdr-Build_Constraints.

For further questions, please feel free to take a look at the Questions wiki page; it has a list of good places for asking questions.

@golang golang locked and limited conversation to collaborators Jun 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants