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: nearest-match package resolution not performed for type queries #18697

Closed
willfaught opened this issue Jan 18, 2017 · 5 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@willfaught
Copy link
Contributor

willfaught commented Jan 18, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7.4 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/will.faught/Developer/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.7.4_2/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.7.4_2/libexec/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jt/c0hjffqj6gxbhy00gm0btzkr79h225/T/go-build032171883=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

File $GOPATH/src/t/u/u.go:

package u

type U struct{}

func (u *U) M() {}
$ go doc u
package u // import "t/u"

type U struct { ... }
$ go doc u U

What did you expect to see?

$ go doc u U
type U struct{}

func (u *U) M()

What did you see instead?

$ go doc u U
doc: cannot find package "u" in any of:
	/usr/local/Cellar/go/1.7.4_2/libexec/src/u (from $GOROOT)
	/Users/will.faught/Developer/go/src/u (from $GOPATH)
exit status 1
@alexd765
Copy link
Contributor

(Should get the prefix cmd/doc:)

This is related to #18664.

In the function parseArgs we spend a lot of effort to find the right thing for go doc with one argument, but we spend no effort for two arguments.

@willfaught willfaught changed the title godoc: nearest-match package resolution not performed for type queries cmd/doc: nearest-match package resolution not performed for type queries Jan 18, 2017
@bradfitz bradfitz added this to the Go1.9Maybe milestone Jan 19, 2017
@bradfitz
Copy link
Contributor

/cc @robpike

@bradfitz bradfitz added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jun 28, 2017
@bradfitz bradfitz modified the milestones: Go1.10, Go1.9Maybe Jun 28, 2017
@robpike robpike self-assigned this Jun 29, 2017
@robpike
Copy link
Contributor

robpike commented Jun 29, 2017

Looks like it should be fixed.

@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 29, 2017
@gopherbot gopherbot removed the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jun 29, 2017
@willfaught
Copy link
Contributor Author

Edited the description to correct the file path to be $GOPATH/src/t/u/u.go instead of $GOPATH/src/t/u.go (consistent with the package u // import "t/u" part).

@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
@rsc rsc unassigned robpike Jun 23, 2022
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

5 participants