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

x/tools/cmd/godoc: goroot flag has no effect when running in command-line mode #13296

0xmohit opened this issue Nov 17, 2015 · 2 comments


None yet
4 participants
Copy link

commented Nov 17, 2015

When running in command-line mode, specifying the -goroot flag has no effect. Running:

godoc -goroot=/usr/local/go1.4.2 math/big

would list Float too:

Package big implements multi-precision arithmetic (big numbers). The
following numeric types are supported:

    Int    signed integers
    Rat    rational numbers
    Float  floating-point numbers

If served over HTTP (godoc -goroot=/usr/local/go1.4.2 math/big -http=:6060), the resulting documentation page is as expected.

Setting GOROOT environment variable instead works as expected:

GOROOT=/usr/local/go1.4.2 godoc math/big

@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Nov 17, 2015


This comment has been minimized.

Copy link

commented Apr 11, 2018

This happens because when a normal package path is passed, the GOROOT is assumed to be build.Default.GOROOT.

If you do - godoc -goroot=/usr/local/go1.4.2 /usr/local/go1.4.2/src/math/big. It gives the correct output. Although it defeats the purpose of passing goroot in the first place.

Will send a fix.


This comment has been minimized.

Copy link

commented Apr 30, 2018

Change mentions this issue: godoc: set the GOROOT path properly in cmdline mode

@golang golang locked and limited conversation to collaborators May 2, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.