xgo
xgo copied to clipboard
no Go files in /
Attempting to cross-compile a plugin fails:
karl@chrx:~/tmp/tgo$ ls
go.mod main.go
karl@chrx:~/tmp/tgo$ cat go.mod
module tgo
go 1.13
karl@chrx:~/tmp/tgo$ cat main.go
package main
func main() {
}
karl@chrx:~/tmp/tgo$ GOPATH=$HOME/go xgo -buildmode=plugin --targets=darwin/* .
Checking docker installation...
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea838
Built: Wed Nov 13 07:29:52 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea838
Built: Wed Nov 13 07:28:22 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
Checking for required docker image karalabe/xgo-latest... found.
Cross compiling ....
Building locally ....
Compiling for darwin-10.6/amd64...
can't load package: package .: no Go files in /
2019/12/09 10:18:31 Failed to cross compile package: exit status 1.
What is the content of your go.mod? Also is there a GOPATH environment variable set?
I have the same problem, and I use the go mod to manage deps
I try to create a soft link use ln -s on $GOPATH/src/poject_path and the project actual path, the problem goes away