I am trying to build packer and I am getting this error:
go install golang.org/x/tools/cmd/vet: open /usr/lib/go/pkg/tool/linux_amd64/vet: permission denied
Makefile:40: recipe for target 'test' failed
make: *** [test] Error 1
Is the installer trying to access my /usr folder? Should I run this under root? How can I fix this?
go vet
is special, in that it's a tool that needs to go in GOROOT. In most installations GOROOT is also user writable, but if you installed via a package manager it won't be.To work around this, you can do this as root to avoid changing any permissions in your GOPATH:
Since
vet
is a tool provided by the official distribution, not having it installed may be considered a bug in gentoo'sgo
package. The officialgo
binary distribution included the following tools: