aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2023-09-22 16:11:36 -0400
committerJonathan Amsterdam <jba@google.com>2023-09-25 16:46:57 +0000
commit70e04706d8ccd4c93de54e1f5c7b15c942018dee (patch)
treef83e58548e0fcf2432c0522f9cd4ce5dc149f882 /src
parent3563792768b1e06da4a0cb5f946adf90d1297766 (diff)
downloadgo-70e04706d8ccd4c93de54e1f5c7b15c942018dee.tar.xz
net/http: remove unused function
Change-Id: I4364d94663282249e632d12026a810147844ad2e Reviewed-on: https://go-review.googlesource.com/c/go/+/530615 Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/net/http/pattern.go14
-rw-r--r--src/net/http/pattern_test.go20
2 files changed, 0 insertions, 34 deletions
diff --git a/src/net/http/pattern.go b/src/net/http/pattern.go
index 0c8644d9cd..f6af19b0f4 100644
--- a/src/net/http/pattern.go
+++ b/src/net/http/pattern.go
@@ -180,20 +180,6 @@ func parsePattern(s string) (_ *pattern, err error) {
return p, nil
}
-// TODO(jba): remove this; it is unused.
-func isValidHTTPToken(s string) bool {
- if s == "" {
- return false
- }
- // See https://www.rfc-editor.org/rfc/rfc9110#section-5.6.2.
- for _, r := range s {
- if !unicode.IsLetter(r) && !unicode.IsDigit(r) && !strings.ContainsRune("!#$%&'*+.^_`|~-", r) {
- return false
- }
- }
- return true
-}
-
func isValidWildcardName(s string) bool {
if s == "" {
return false
diff --git a/src/net/http/pattern_test.go b/src/net/http/pattern_test.go
index b219648f33..f0c84d243e 100644
--- a/src/net/http/pattern_test.go
+++ b/src/net/http/pattern_test.go
@@ -145,26 +145,6 @@ func (p1 *pattern) equal(p2 *pattern) bool {
slices.Equal(p1.segments, p2.segments)
}
-func TestIsValidHTTPToken(t *testing.T) {
- for _, test := range []struct {
- in string
- want bool
- }{
- {"", false},
- {"GET", true},
- {"get", true},
- {"white space", false},
- {"#!~", true},
- {"a-b1_2", true},
- {"notok)", false},
- } {
- got := isValidHTTPToken(test.in)
- if g, w := got, test.want; g != w {
- t.Errorf("%q: got %t, want %t", test.in, g, w)
- }
- }
-}
-
func mustParsePattern(tb testing.TB, s string) *pattern {
tb.Helper()
p, err := parsePattern(s)