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

Open
DeedleFake opened this issue Oct 2, 2019 · 4 comments

Comments

@DeedleFake
Copy link

commented Oct 2, 2019

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

This comment has been minimized.

Copy link
Member

commented Oct 2, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Oct 3, 2019

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

@DeedleFake

This comment has been minimized.

Copy link
Author

commented Oct 3, 2019

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

This comment has been minimized.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.