I have this weird issue.
When I run go env
, I get the following:
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ethanc/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/ethanc/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/ethanc/marketstore/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build154822748=/tmp/go-build -gno-record-gcc-switches"
But when, I run echo $GOPATH
, I get an empty new line. This happens for all other GO environment values as well when I try to echo them out:
This doesn't make sense because when I try to print out other path variables like echo $HOME
, I get the correct value:
/home/ethanc
Does anyone have any idea why when I echo my GOPATH
, only a new line is returned?
This is the default value for GOPATH.
Since it's never set, go will use it's reasonable default.
Main consquence of course is all your go projects sharing this $GOPATH.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With