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

Comments

Projects
None yet
2 participants
@bradfitz
Copy link
Member

commented Oct 11, 2018

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 this to the Go1.12 milestone Oct 11, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Oct 11, 2018

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

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