You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have Go installed to a non-standard path. With Go 1.9 all you need is the go executable on the path and then Go figures everything out from there. However godef is not so clever and wants GOROOT to be set.
The following shows my Go environment with godef not working and then me setting GOROOT to get it working.
$ ls -l `which go`
lrwxrwxrwx 1 root root 29 Sep 12 11:01 /usr/bin/go -> /home/duncan/.go/go1.9/bin/go
$ set | fgrep GO
GOPATH=/home/duncan/.local
$ go version
go version go1.9 linux/amd64
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/duncan/.local"
GORACE=""
GOROOT="/home/duncan/.go/go1.9"
GOTOOLDIR="/home/duncan/.go/go1.9/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build177033922=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
$ godef -f pkg/data/codebook/codebook.go csv.Reader
parseLocalPackage error: no more package files found
godef: no declaration found for csv.Reader
$ export GOROOT=/home/duncan/.go/go1.9
$ godef -f pkg/data/codebook/codebook.go csv.Reader
/home/duncan/.go/go1.9/src/encoding/csv/reader.go:90:6
$ set | fgrep GO
GOPATH=/home/duncan/.local
GOROOT=/home/duncan/.go/go1.9
$
The text was updated successfully, but these errors were encountered:
`:GoDef` (and `gd`) in Vim was broken for the standard library.
rogpeppe/godef#73
Try and find a different approach in the long-run.
Setting `GOROOT` is not recommended.
I have Go installed to a non-standard path. With Go 1.9 all you need is the
go
executable on the path and then Go figures everything out from there. Howevergodef
is not so clever and wantsGOROOT
to be set.The following shows my Go environment with
godef
not working and then me settingGOROOT
to get it working.The text was updated successfully, but these errors were encountered: