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
What version of Go are you using (go version)?
go version devel +29f0984 Fri Jul 1 01:12:24 2016 +0000 linux/amd64
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/i4k/projects/go-workspace"
GORACE=""
GOROOT="/home/i4k/projects/personal/go"
GOTOOLDIR="/home/i4k/projects/personal/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build340179415=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
What did you do?
The go doc tool fail to work in case of failing to open some directory inside GOPATH. In my case I have some projects with directories owned by root inside GOPATH (because of some programs doing sudo make build-rootfs and things like that) and then go doc stop walking dirs in the first permission denied error... Making it unusable to find deep packages inside projects on my machine.
λ> go doc somepkg.SomeFunc
doc: error opening /home/i4k/projects/go-workspace/src/XXXXX/build/rootfs/root: open /home/i4k/projects/go-workspace/src/XXXXX/build/rootfs/root: permission denied
doc: error opening /home/i4k/projects/go-workspace/src/YYYYYY/build/rootfs/root: open /home/i4k/projects/go-workspace/src/YYYYYY/build/rootfs/root: permission denied
doc: error opening /home/i4k/projects/go-workspace/src/ZZZZZZ/build/rootfs/tmp/go-build247046776: open /home/i4k/projects/go-workspace/src/ZZZZZ/build/rootfs: permission denied
func SomeFunc(format string, arg ...interface{}) error
Documentation
What did you see instead?
λ> go doc somepkg.SomeFunc
doc: error opening /home/i4k/projects/go-workspace/src/XXXXX/build/root: open /home/i4k/projects/go-workspace/src/XXXXX/build/root: permission denied
doc: no buildable Go source files in /home/i4k
exit status 1
The text was updated successfully, but these errors were encountered:
go version
)?go version devel +29f0984 Fri Jul 1 01:12:24 2016 +0000 linux/amd64
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/i4k/projects/go-workspace"
GORACE=""
GOROOT="/home/i4k/projects/personal/go"
GOTOOLDIR="/home/i4k/projects/personal/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build340179415=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
The
go doc
tool fail to work in case of failing to open some directory inside GOPATH. In my case I have some projects with directories owned by root inside GOPATH (because of some programs doingsudo make build-rootfs
and things like that) and thengo doc
stop walking dirs in the first permission denied error... Making it unusable to find deep packages inside projects on my machine.Changing the
return
to acontinue
in the line below gets what I expect, but I don't know if it's acceptable.https://github.com/golang/go/blob/master/src/cmd/doc/dirs.go#L81
The text was updated successfully, but these errors were encountered: