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: inconsistent "import relative to unknown directory" #18664

Closed
minux opened this issue Jan 15, 2017 · 3 comments
Closed

cmd/doc: inconsistent "import relative to unknown directory" #18664

minux opened this issue Jan 15, 2017 · 3 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@minux
Copy link
Member

minux commented Jan 15, 2017

Repo:

$ cd $GOROOT/src/os
$ go doc ./exec
package exec // import "os/exec"
.... 
$ go doc ./exec Cmd
doc: import "./exec": import relative to unknown directory
exit status 1

If cmd/doc can find the package docs on the first invocation, why couldn't it find the the same package on the 2nd invocation?
Additionally, the error also doesn't make sense: of course it knows the directory the import relative to (the cwd).

/cc @robpike

@minux minux added this to the Go1.9 milestone Jan 15, 2017
@gopherbot
Copy link

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

@cybrcodr
Copy link
Contributor

cybrcodr commented Feb 7, 2017

From go doc usage ...

The package path must be either a qualified path or a proper suffix of a path. The go tool's usual package mechanism does not apply: package path elements like . and ... are not implemented by go doc.

Based on above description, I think the issue is on the first invocation rather than the second. Note that the following invocations work correctly (assuming you have set GOROOT/GOPATH properly).

$ go doc exec Cmd (if currently under os/)

$ go doc os/exec Cmd

@bradfitz bradfitz modified the milestones: Go1.10, Go1.9 Jul 18, 2017
@bradfitz bradfitz added NeedsFix The path to resolution is known, but the work has not been done. release-blocker help wanted labels Jul 18, 2017
@gopherbot
Copy link

Change https://golang.org/cl/59413 mentions this issue: cmd/doc: search for packages in the two-arg case

@golang golang locked and limited conversation to collaborators Aug 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

4 participants