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: url flag's response recorder ignores body #30261

Closed
rhysh opened this issue Feb 15, 2019 · 4 comments
Closed

x/tools/cmd/godoc: url flag's response recorder ignores body #30261

rhysh opened this issue Feb 15, 2019 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rhysh
Copy link
Contributor

rhysh commented Feb 15, 2019

What version of Go are you using (go version)?

$ go version
go version devel +701f6a27b5 Mon Feb 11 18:18:45 2019 +0000 darwin/amd64

I'm comparing the x/tools repo at release-branch.go1.11 vs release-branch.go1.12.

Does this issue reproduce with the latest release?

Yes, this is broken in master of the x/tools repo.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/rhys/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/rhys/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/49/zmds5zsn75z1283vtzxyfr5hj7yjq4/T/go-build329945537=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ go run golang.org/x/tools/cmd/godoc -url=/ -http=""

What did you expect to see?

I expected to see HTML similar to what's served by the root of https://golang.org/

What did you see instead?

The command returned no output.


I have a fix for this, including regression tests. I'll upload it shortly.

@gopherbot gopherbot added this to the Unreleased milestone Feb 15, 2019
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/162907 mentions this issue: cmd/godoc: fix -url flag, add tests

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Feb 18, 2019
@dmitshur
Copy link
Contributor

dmitshur commented Feb 18, 2019

This is a regression from CL 141417, where the httptest.ResponseRecorder type was replaced with a custom implementation in order to fix #28138. It wasn't caught because we didn't have a test for the -url flag yet (we will after your CL, thanks for that).

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Feb 18, 2019
@rhysh
Copy link
Contributor Author

rhysh commented Feb 19, 2019

@gopherbot please backport to 1.12

@gopherbot
Copy link
Contributor

Backport issue(s) opened: #30314 (for 1.12).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

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

No branches or pull requests

3 participants