I'm having annoying issue with go install
command.
Every time I try to run it within the src
directory of my GOPATH the resulted file is getting created in GOROOT/bin directory for some reason.
I verified my environmental variables in .bashrc and also run 'go env' (see below) and couldn't find any issues:
.bashrc
export GOBIN=$HOME/dev/src/go/bin
export GOPATH=$HOME/dev/go-dev
export PATH=$PATH:$GOBIN:$GOPATH/bin
go env
GOARCH="amd64"
GOBIN="/home/user/dev/src/go/bin"
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/dev/go-dev"
GORACE=""
GOROOT="/home/user/dev/src/go"
GOTOOLDIR="/home/user/dev/src/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread"
CGO_ENABLED="1"
This post has a similar problem except I have GOPATH in my env (I tried the solution but it didn't help).
When I tried to create the test library using official GoLang site and run go install I've got a proper file created in $GOPATH/pgk/linux_amd64 but not in the bin directory.
Am I missing something in my configuration?