I attempted to cross-compile something on my darwin-amd64 machine.
It kept saying can't load package: package .: build constraints exclude all Go files in
I had no build constraints in any of my files or dependency packages.
This confused me for hours as I kept trying different things until I realised it was because I was using cgo.
I think the error message should be more explanatory in c-go cross compilation situations.
For future readers:
https://github.com/karalabe/xgo
Seems like a duplicate of #24068.
Yes, this is a dup of #24068. We can keep this as a search-able reference for that error on the issue tracker, but let's close it.
How this error can be solved? Thanks.
I am also facing the same issue. How this error can be solved?
This issue was closed as a duplicate of another; see https://github.com/golang/go/issues/24068 and all the details there.
Most helpful comment
How this error can be solved? Thanks.