Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/doc: Stops walking directories in case of open fails #16240

Closed
i4ki opened this issue Jul 1, 2016 · 2 comments
Closed

cmd/doc: Stops walking directories in case of open fails #16240

i4ki opened this issue Jul 1, 2016 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@i4ki
Copy link

i4ki commented Jul 1, 2016

  1. What version of Go are you using (go version)?
    go version devel +29f0984 Fri Jul 1 01:12:24 2016 +0000 linux/amd64
  2. 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"
  3. 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.

Changing the return to a continue 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

  1. What did you expect to see?
λ> 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
  1. 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
@bradfitz bradfitz added this to the Go1.8Maybe milestone Jul 1, 2016
@robpike robpike self-assigned this Jul 1, 2016
@quentinmit quentinmit added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 10, 2016
@rsc
Copy link
Contributor

rsc commented Oct 20, 2016

Sounds reasonable.

@rsc rsc assigned quentinmit and unassigned robpike Oct 20, 2016
@rsc rsc modified the milestones: Go1.8, Go1.8Maybe Oct 20, 2016
@gopherbot
Copy link

CL https://golang.org/cl/31713 mentions this issue.

@golang golang locked and limited conversation to collaborators Oct 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants