-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: "go doc . foo" not working on Windows? #27881
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
Comments
/cc @robpike |
To your first point: Instead of your suggested To the second point: I also don't like adding a special case for a special case, so to speak, although I am less bothered by it. It's just complication. The current rule is documented and works. So one strong thumb down and one mild thumb down from me. |
You can't, though.
Attempting to run
I certainly wouldn't have a problem with that working, though. |
I just tried this and it worked. I am using (approximately) go 1.11.
So please give an example that fails. I don't know why the documentation says it doesn't work but I'd like to understand your issue first. |
I did some quick testing. It's working for me on Linux but not on Windows. I tried 1.11.1 on Windows and both 1.11 and 1.11.1 on Linux. |
I suspect this is about the |
I just tried this on current tip on Windows, and I cannot reproduce the problem:
@DeedleFake what did I do wrong? Thank you. Alex |
@robpike @alexbrainman I'm not sure. I was able to reproduce it on multiple Windows machines with both PowerShell and Cmd. I haven't tried with the latest |
It sounds like as far as a proposal is concerned, we don't need to do |
@DeedleFake, please post the output of both |
Here's one with the latest
I get the exact same results with packages outside the standard library as well, whether or not they're in GOPATH and whether or not they're modules. Here's the output of set GOARCH=amd64
set GOBIN=
set GOCACHE=$HOME\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=$HOME\Devel\Go
set GOPROXY=
set GORACE=
set GOROOT=$HOME\scoop\apps\go\current
set GOTMPDIR=
set GOTOOLDIR=$HOME\scoop\apps\go\current\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=$HOME\AppData\Local\Temp\go-build244586810=/tmp/go-build -gno-record-gcc-switches |
Change https://golang.org/cl/164759 mentions this issue: |
The documentation notes that starting an identifier with a capital letter forces the current package, but if you're attempting to look up something that is unexported then this workaround doesn't apply, which can be annoying sometimes. I propose, therefore, that prefixing an identifier with a
.
, such asgo doc .testing
, should forcego doc
to only look up the identifier in the current package. Alternatively, when looking something up the current package, as specified by the use of a capital letter, and-u
is given, then it should also match unexported identifiers despite the case mismatch.The text was updated successfully, but these errors were encountered: