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: prevent the the httptest.serve flag #28138

Closed
bradfitz opened this issue Oct 11, 2018 · 1 comment
Closed

x/tools/cmd/godoc: prevent the the httptest.serve flag #28138

bradfitz opened this issue Oct 11, 2018 · 1 comment
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bradfitz
Copy link
Contributor

x/tools/cmd/godoc uses the usually-test-only net/http/httptest package.

But because httptest assumes it's running in a test, it registers its own flags, which means godoc ends up with mysterious flags:

  -goroot string
        Go root directory (default "/home/bradfitz/go")
  -http string
        HTTP service address (default "localhost:6060")
  -httptest.serve string
        if non-empty, httptest.NewServer serves on this address and blocks
  -index
        enable search index

Either stop using in httptest in godoc, or change httptest to somehow conditionally register that flag. Perhaps only if it looks like we're in a test binary. (check lookup of other testing flags?)

@bradfitz bradfitz added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Oct 11, 2018
@bradfitz bradfitz added this to the Go1.12 milestone Oct 11, 2018
@gopherbot
Copy link

Change https://golang.org/cl/141417 mentions this issue: cmd/godoc: do not use httptest

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants