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/go: doc fails on case-insensitive search for identifier similar to keyword #34656

Closed
DeedleFake opened this issue Oct 2, 2019 · 8 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@DeedleFake
Copy link

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

$ go version
go version go1.13.1 linux/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="$HOME/.cache/go-build"
GOENV="$HOME/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="$HOME/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="$HOME/.go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="$HOME/.go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build199061115=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ go doc importer.default

What did you expect to see?

package importer // import "go/importer"

func Default() types.Importer
    Default returns an Importer for the compiler that built the running binary.
    If available, the result implements types.ImporterFrom.

What did you see instead?

doc: invalid identifier "default"
exit status 1
@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 2, 2019
@andybons
Copy link
Member

andybons commented Oct 2, 2019

@mvdan @robpike

@andybons andybons added this to the Unplanned milestone Oct 2, 2019
@robpike
Copy link
Contributor

robpike commented Oct 3, 2019

This seems more annoying to fix than it's worth, since typing the actual name will work.

@DeedleFake
Copy link
Author

Makes sense. Maybe instead a line could be inserted in the help to document the behavior.

Alternatively, would you accept a pull request to fix it? I might look into sending one if I have time at some point.

@mvdan
Copy link
Member

mvdan commented Oct 3, 2019

@DeedleFake I think investigating if a simple fix exists would be useful. But if the fix adds a non-trivial amount of complexity, then I'd agree with Rob that it's probably not worth merging.

A CL would be useful either way though, for future reference.

@andybons andybons added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 4, 2019
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@cespare
Copy link
Contributor

cespare commented Nov 7, 2019

This bites me semi-regularly. I never type capital letters into my go doc query (why bother?) and so I get annoying failures every time the thing I'm looking for happens to be a keyword.

$ go doc sort.interface
doc: invalid identifier "interface"
exit status 1
$ go doc types.type
doc: invalid identifier "type"
exit status 1

@gopherbot
Copy link

Change https://golang.org/cl/205778 mentions this issue: cmd/doc: don't bother checking validity of symbols at top level

@agnivade
Copy link
Contributor

agnivade commented Nov 7, 2019

Reopening for the CL to close it.

@agnivade agnivade reopened this Nov 7, 2019
@agnivade agnivade removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Nov 7, 2019
@mvdan mvdan reopened this Nov 7, 2019
@golang golang locked and limited conversation to collaborators Nov 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

7 participants