我的go环境
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT=""
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
我在我的Mac上编译并成功执行了二进制文件,然后将其复制到上面展示go env的Ubuntu机器上。当我调用myprog二进制文件时,我得到了以下结果
bash: /usr/local/go/bin/myprog: cannot execute binary file: Exec format error