asdf-golang icon indicating copy to clipboard operation
asdf-golang copied to clipboard

Both `$GOPATH` or `$GOROOT` are not set & request for a custom place to use my installed go version

Open MuhmdRaouf opened this issue 4 years ago • 15 comments

Describe the bug Both $GOPATH or $GOROOT are not.

snowflake in ~
➜ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/snowflake/Library/Caches/go-build"
GOENV="/Users/snowflake/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/snowflake/.asdf/installs/golang/1.13.8/packages"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/snowflake/.asdf/installs/golang/1.13.8/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/snowflake/.asdf/installs/golang/1.13.8/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/35/t0nqj9vd2zd735xf5d05ybzr0000gn/T/go-build082200721=/tmp/go-build -gno-record-gcc-switches -fno-common"

snowflake in ~
➜ echo $GOROOT


snowflake in ~
➜ echo $GOPATH


snowflake in ~
➜ asdf version
v0.7.6

To Reproduce Steps to reproduce the behavior:

  1. Install go using asdf-golang
  2. switch to any version of the currently installed go
  3. echo $GOPATH or $GOROOT
  4. return emptiness :D

Expected behavior To Have $GOPATH & $GOROOT set.

Desktop (please complete the following information):

  • OS: macOS Catalina Version 10.15.3
  • SHELL: zsh 5.7.1 (x86_64-apple-darwin19.0)

Additional context Can I add a sort of Place to put my $GOPATH & $GOROOT as I want them to be inside of go folder inside of my home directory and the library append on it. eg: installing go 1.13.8 with the following environment variable ASDF_GOLANG_CUSTOM_PATH=$HOME/go so my $GOPATH & $GOROOT set as the following $GOPATH=ASDF_GOLANG_PATH/1.13.8/...... $GOROOT=ASDF_GOLANG_PATH/1.13.8/......

MuhmdRaouf avatar Feb 24 '20 10:02 MuhmdRaouf