From acc9a9c3338373f5a9376ff2eb1decd30bbee04d Mon Sep 17 00:00:00 2001 From: Cole Garien Date: Sat, 13 Sep 2025 12:48:53 -0500 Subject: [PATCH] streamline wordings --- src/net/http/csrf.go | 2 +- src/net/http/server.go | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/net/http/csrf.go b/src/net/http/csrf.go index 3b6b58d9f3..0b71b40389 100644 --- a/src/net/http/csrf.go +++ b/src/net/http/csrf.go @@ -91,7 +91,7 @@ var sentinelHandler Handler = &noopHandler{} // trailing slash) are not. // // AddInsecureBypassPattern panics if the pattern conflicts with one already -// bypassed, or if the pattern is syntactically invalid (for example, an +// registered, or if the pattern is syntactically invalid (for example, an // improperly formed wildcard). // // AddInsecureBypassPattern can be called concurrently with other methods or diff --git a/src/net/http/server.go b/src/net/http/server.go index 19ce0e1005..4078c89906 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -2868,12 +2868,10 @@ func (mux *ServeMux) ServeHTTP(w ResponseWriter, r *Request) { // always refers to user code. // Handle registers the handler for the given pattern. +// If the given pattern conflicts with one that is already registered +// or if the pattern is invalid, Handle panics. // -// Handle panics if the pattern conflicts with one already registered -// or if the pattern is syntactically invalid (for example, an -// improperly formed wildcard). -// -// For details on valid patterns and conflict rules, see [ServeMux]. +// See [ServeMux] for details on valid patterns and conflict rules. func (mux *ServeMux) Handle(pattern string, handler Handler) { if use121 { mux.mux121.handle(pattern, handler) @@ -2883,12 +2881,10 @@ func (mux *ServeMux) Handle(pattern string, handler Handler) { } // HandleFunc registers the handler function for the given pattern. +// If the given pattern conflicts with one that is already registered +// or if the pattern is invalid, HandleFunc panics. // -// HandleFunc panics if the pattern conflicts with one already -// registered or if the pattern is syntactically invalid (for example, -// an improperly formed wildcard). -// -// For details on valid patterns and conflict rules, see [ServeMux]. +// See [ServeMux] for details on valid patterns and conflict rules. func (mux *ServeMux) HandleFunc(pattern string, handler func(ResponseWriter, *Request)) { if use121 { mux.mux121.handleFunc(pattern, handler)