This is a creation in Article, where the information may have evolved or changed.
Problem
get github.com/tsenart/vegeta# ErrornotsetFor more details see: go help gopath
Root
# ~/.BASHRC╭─xiaojia@xiaojia-Lenovo-G460~╰─$ Go envGoarch="AMD64"GOBIN="/usr/local/go/bin"Goexe=""Gohostarch="AMD64"Gohostos="Linux"GOOS="Linux"Gopath="/home/xiaojia/gocode"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"#/etc/profile╭─xiaojia@xiaojia-Lenovo-G460~╰─$ sudo go env[sudo] Password for Xiaojia: Goarch="AMD64"GOBIN="" # # # Not setGoexe=""Gohostarch="AMD64"Gohostos="Linux"GOOS="Linux"Gopath="" # # # Not setGorace=""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"
Xubuntu This configuration is good, as for why Ubuntu, and still do not solve the problem, we have to first use the temporary solution: sudo -E go env
, with the-e parameter to force the use of the current user environment variables.
Reference Links: Detailed configuration