[go] net/http: fix link to ResponseWriter trailer example

22 views
Skip to first unread message

Reilly Watson (Gerrit)

unread,
Dec 20, 2021, 5:00:14 PM12/20/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Reilly Watson has uploaded this change for review.

View Change

net/http: fix link to ResponseWriter trailer example

The links to this example were using an underscore separator
instead of a hyphen, and incorrect casing.

Fixes #50279

Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
---
M src/net/http/server.go
M src/net/http/h2_bundle.go
2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go
index bb82f24..0a1a2a9 100644
--- a/src/net/http/h2_bundle.go
+++ b/src/net/http/h2_bundle.go
@@ -6266,7 +6266,7 @@
// or known before the header is written, the normal Go trailers mechanism
// is preferred:
// https://golang.org/pkg/net/http/#ResponseWriter
-// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
+// https://golang.org/pkg/net/http/#example-ResponseWriter-Trailers
const http2TrailerPrefix = "Trailer:"

// promoteUndeclaredTrailers permits http.Handlers to set trailers
diff --git a/src/net/http/server.go b/src/net/http/server.go
index ddc799b..30eab49 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -495,7 +495,7 @@
// or known before the header is written, the normal Go trailers mechanism
// is preferred:
// https://golang.org/pkg/net/http/#ResponseWriter
-// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
+// https://golang.org/pkg/net/http/#example-ResponseWriter-Trailers
const TrailerPrefix = "Trailer:"

// finalTrailers is called after the Handler exits and returns a non-nil

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 1
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-MessageType: newchange

Ian Lance Taylor (Gerrit)

unread,
Dec 20, 2021, 5:06:18 PM12/20/21
to Reilly Watson, goph...@pubsubhelper.golang.org, Damien Neil, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Damien Neil.

View Change

1 comment:

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 1
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Reilly Watson <reilly...@gmail.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Comment-Date: Mon, 20 Dec 2021 22:06:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reilly Watson (Gerrit)

unread,
Dec 20, 2021, 5:08:19 PM12/20/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Damien Neil.

Reilly Watson uploaded patch set #2 to this change.

View Change

net/http: fix link to ResponseWriter trailer example

The links to this example were using an underscore separator
instead of a hyphen, and incorrect casing.

Fixes #50279

Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
---
M src/net/http/server.go
M src/net/http/h2_bundle.go
2 files changed, 18 insertions(+), 4 deletions(-)

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 2
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Reilly Watson <reilly...@gmail.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-MessageType: newpatchset

Ian Lance Taylor (Gerrit)

unread,
Dec 20, 2021, 5:15:20 PM12/20/21
to Reilly Watson, goph...@pubsubhelper.golang.org, Damien Neil, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Damien Neil.

View Change

1 comment:

  • Patchset:

    • Patch Set #2:

      Sorry, just noticed that you are changing h2_bundle.go. As it says at the top of the file, that file is generated and should not be edited directly.

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 2
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Reilly Watson <reilly...@gmail.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Comment-Date: Mon, 20 Dec 2021 22:15:13 +0000

Reilly Watson (Gerrit)

unread,
Dec 20, 2021, 5:17:04 PM12/20/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Damien Neil.

Reilly Watson uploaded patch set #3 to this change.

View Change

net/http: fix link to ResponseWriter trailer example

The links to this example were using an underscore separator
instead of a hyphen, and incorrect casing.

Fixes #50279

Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
---
M src/net/http/server.go
M src/net/http/h2_bundle.go
2 files changed, 17 insertions(+), 3 deletions(-)

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 3
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Reilly Watson <reilly...@gmail.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-MessageType: newpatchset

Reilly Watson (Gerrit)

unread,
Dec 20, 2021, 5:18:44 PM12/20/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Damien Neil.

Reilly Watson uploaded patch set #4 to this change.

View Change

net/http: fix link to ResponseWriter trailer example

The links to this example were using an underscore separator
instead of a hyphen, and incorrect casing.

Fixes #50279

Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
---
M src/net/http/server.go
1 file changed, 16 insertions(+), 2 deletions(-)

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 4

Brad Fitzpatrick (Gerrit)

unread,
Dec 20, 2021, 6:16:09 PM12/20/21
to Reilly Watson, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Ian Lance Taylor, Damien Neil, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Damien Neil.

View Change

1 comment:

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 4
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Reilly Watson <reilly...@gmail.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Comment-Date: Mon, 20 Dec 2021 23:16:03 +0000

Reilly Watson (Gerrit)

unread,
Dec 20, 2021, 9:23:48 PM12/20/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Damien Neil.

Reilly Watson uploaded patch set #5 to this change.

View Change

net/http: fix link to ResponseWriter trailer example

The links to this example were using an underscore separator
instead of a hyphen, and incorrect casing.

Fixes #50279

Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
---
M src/net/http/server.go
1 file changed, 16 insertions(+), 2 deletions(-)

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 5
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Reilly Watson <reilly...@gmail.com>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-MessageType: newpatchset

Reilly Watson (Gerrit)

unread,
Dec 20, 2021, 9:24:27 PM12/20/21
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Damien Neil.

Reilly Watson uploaded patch set #6 to this change.

View Change

net/http: fix link to ResponseWriter trailer example

The links to this example were using an underscore separator
instead of a hyphen, and incorrect casing.

Fixes #50279

Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
---
M src/net/http/server.go
1 file changed, 16 insertions(+), 2 deletions(-)

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 6

Ian Lance Taylor (Gerrit)

unread,
Dec 20, 2021, 9:28:17 PM12/20/21
to Reilly Watson, goph...@pubsubhelper.golang.org, Brad Fitzpatrick, Damien Neil, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Brad Fitzpatrick, Damien Neil.

Patch set 6:Code-Review +2

View Change

2 comments:

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 6
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Reilly Watson <reilly...@gmail.com>
Gerrit-Attention: Brad Fitzpatrick <brad...@golang.org>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Comment-Date: Tue, 21 Dec 2021 02:28:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Brad Fitzpatrick <brad...@golang.org>
Gerrit-MessageType: comment

Reilly Watson (Gerrit)

unread,
Dec 20, 2021, 9:32:20 PM12/20/21
to goph...@pubsubhelper.golang.org, Ian Lance Taylor, Brad Fitzpatrick, Damien Neil, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Brad Fitzpatrick, Damien Neil.

View Change

3 comments:

  • Patchset:

    • Patch Set #1:

      Thanks. As long as we are touching these lines, let's switch them to go.dev rather than golang.org. […]

      Makes sense, thanks! Updated.

  • Patchset:

    • Patch Set #2:

      Sorry, just noticed that you are changing h2_bundle.go. […]

      Ah geez you're right, sorry about that! Good catch, updated.

  • File src/net/http/server.go:

    • Ah so it does! Updated, thanks :)

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 6
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Brad Fitzpatrick <brad...@golang.org>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Comment-Date: Tue, 21 Dec 2021 02:32:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Brad Fitzpatrick <brad...@golang.org>
Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>
Gerrit-MessageType: comment

Emmanuel Odeke (Gerrit)

unread,
Dec 20, 2021, 10:54:37 PM12/20/21
to Reilly Watson, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Brad Fitzpatrick, Damien Neil, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Reilly Watson, Brad Fitzpatrick, Damien Neil.

Patch set 6:Code-Review +2

View Change

1 comment:

  • Patchset:

    • Patch Set #6:

      Thank you for the fix Reilly! Thank you for the co-review, Ian!

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 6
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-Attention: Reilly Watson <reilly...@gmail.com>
Gerrit-Attention: Brad Fitzpatrick <brad...@golang.org>
Gerrit-Attention: Damien Neil <dn...@google.com>
Gerrit-Comment-Date: Tue, 21 Dec 2021 03:54:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Emmanuel Odeke (Gerrit)

unread,
Dec 20, 2021, 10:54:42 PM12/20/21
to Reilly Watson, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Ian Lance Taylor, Brad Fitzpatrick, Damien Neil, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

Emmanuel Odeke submitted this change.

View Change


Approvals: Emmanuel Odeke: Looks good to me, approved Ian Lance Taylor: Looks good to me, approved
net/http: fix link to ResponseWriter trailer example

The links to this example were using an underscore separator
instead of a hyphen, and incorrect casing.

Fixes #50279

Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Reviewed-on: https://go-review.googlesource.com/c/go/+/373514
Reviewed-by: Ian Lance Taylor <ia...@golang.org>
Reviewed-by: Emmanuel Odeke <emma...@orijtech.com>
---
M src/net/http/server.go
1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/net/http/server.go b/src/net/http/server.go
index ddc799b..ffb742b 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -494,8 +494,8 @@
// prior to the headers being written. If the set of trailers is fixed

// or known before the header is written, the normal Go trailers mechanism
// is preferred:
-//    https://golang.org/pkg/net/http/#ResponseWriter
-// https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
+// https://pkg.go.dev/net/http#ResponseWriter
+// https://pkg.go.dev/net/http#example-ResponseWriter-Trailers

const TrailerPrefix = "Trailer:"

// finalTrailers is called after the Handler exits and returns a non-nil

To view, visit change 373514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I35d76a8a78cd708b7505ff1a70f7dacddaf43efd
Gerrit-Change-Number: 373514
Gerrit-PatchSet: 7
Gerrit-Owner: Reilly Watson <reilly...@gmail.com>
Gerrit-Reviewer: Damien Neil <dn...@google.com>
Gerrit-Reviewer: Emmanuel Odeke <emma...@orijtech.com>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-CC: Brad Fitzpatrick <brad...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Russ Cox <r...@golang.org>
Gerrit-MessageType: merged
Reply all
Reply to author
Forward
0 new messages