Closed
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go version go1.8.3 linux/amd64
What operating system and processor architecture are you using (go env
)?
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
What did you do?
I'm using fish shell and the GOROOT
is seted in my config.fish
file
➜ kubernetes git:(master) cat $HOME/.config/fish/config.fish
set TERM xterm-256color
set GOPATH $HOME/go
set PATH $GOPATH $PATH
set GOROOT $HOME/.programs/go
set PATH $GOROOT/bin $PATH
set PATH $GOPATH $PATH
set PATH $GOROOT $PATH
# kubernetes development environment
set working_dir $GOPATH/src/k8s.io
set user walteraa
I have verified if GOROOT
is defined correctly, as you can see below
➜ kubernetes git:(master) echo $GOROOT
/home/walteralves/.programs/go
I have a similar configuration in my .bashrc
, as you can see below
export GOPATH=$HOME/go
export GOROOT=$HOME/.programs/go
export working_dir=$GOPATH/src/k8s.io
export user=walteraa
What did you expect to see?
When I am in bash shell, and a run go env
, everything looks good
walteralves@carvalheira-pc-198:~/go/src/k8s.io/kubernetes$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/walteralves/go"
GORACE=""
GOROOT="/home/walteralves/.programs/go"
GOTOOLDIR="/home/walteralves/.programs/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build463961936=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you see instead?
But, when I am in the fish shell, my GOROOT
isn't updated correctly, but the GOPATH is
➜ kubernetes git:(master) go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/walteralves/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build753890953=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
There some way to fix it in my fish environment?
Activity
walteraa commentedon Aug 3, 2017
Notice: I did a workaround to make my environment work(I have created a symbolic link to my
GOROOT
in the/usr/local
folder.davecheney commentedon Aug 4, 2017
zegl commentedon Aug 4, 2017
You are not using
set
correctly: https://fishshell.com/docs/current/commands.html#setUse
set -gx GOROOT $HOME/.programs/go
instead.davecheney commentedon Aug 4, 2017
Closing based on @zegl 's comment.
walteraa commentedon Aug 4, 2017
Thank you @zegl
[-]GOROOT issue using fish shell[/-][+]cmd/go: GOROOT issue using fish shell[/+]