Go: cmd/go: can't load package: build constraints exclude all Go files in

Created on 17 Mar 2018  ·  5Comments  ·  Source: golang/go

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

Most helpful comment

How this error can be solved? Thanks.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings