]> Cypherpunks repositories - gostls13.git/commitdiff
src/net/http: remove ServeMux.patterns
authorJonathan Amsterdam <jba@google.com>
Fri, 27 Sep 2024 17:46:56 +0000 (13:46 -0400)
committerJonathan Amsterdam <jba@google.com>
Wed, 2 Oct 2024 15:22:08 +0000 (15:22 +0000)
Remove an unexported field from ServeMux that was there only to support
some Google-internal packages. It is no longer needed.

Change-Id: I6a4d542c6c016f5a9f3d24d0c73f6ddd44c9562e
Reviewed-on: https://go-review.googlesource.com/c/go/+/616355
Reviewed-by: Chressie Himpel <chressie@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/http/server.go

index 0b56edf2310c2c109860fb55b20316deb5519f1b..bd16eeb08e64350dda9a7b7e84d8a0edb3f03df9 100644 (file)
@@ -2503,11 +2503,10 @@ func RedirectHandler(url string, code int) Handler {
 //     This change mostly affects how paths with %2F escapes adjacent to slashes are treated.
 //     See https://go.dev/issue/21955 for details.
 type ServeMux struct {
-       mu       sync.RWMutex
-       tree     routingNode
-       index    routingIndex
-       patterns []*pattern  // TODO(jba): remove if possible
-       mux121   serveMux121 // used only when GODEBUG=httpmuxgo121=1
+       mu     sync.RWMutex
+       tree   routingNode
+       index  routingIndex
+       mux121 serveMux121 // used only when GODEBUG=httpmuxgo121=1
 }
 
 // NewServeMux allocates and returns a new [ServeMux].
@@ -2838,7 +2837,6 @@ func (mux *ServeMux) registerErr(patstr string, handler Handler) error {
        }
        mux.tree.addPattern(pat, handler)
        mux.index.addPattern(pat)
-       mux.patterns = append(mux.patterns, pat)
        return nil
 }