Go does not detect the `sync` package
If you installed go from source , check what $GOROOT
et ^ refers to $GOROOT_FINAL
: if they differ, you need to reset your GOROOT
to GOROOT_FINAL
.
The value accepted by the installed binaries and scripts when
$GOROOT
not explicitly specified.
The default is$GOROOT
.If you want to build the Go tree in one location, but move it to a different location after building, set it
$GOROOT_FINAL
to a possible location.
From comments the OP points out:
go version
deduces
go version xgcc (Ubuntu 4.9.1-0ubuntu1) 4.9.1 linux/amd64
And $GOROOT/pkg/linux_amd64/sync.a
there is.
I recommended to $PATH
include $GOROOT/bin
JimB add:
to make sure your
$PATH
contains$GOROOT/bin
for the correct oneGOROOT
. I think you have two settings that make this more confusing.
source to share