Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 70e0470

Browse files
committed
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>
1 parent 3563792 commit 70e0470

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

‎src/net/http/pattern.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,6 @@ func parsePattern(s string) (_ *pattern, err error) {
180180
return p, nil
181181
}
182182

183-
// TODO(jba): remove this; it is unused.
184-
func isValidHTTPToken(s string) bool {
185-
if s == "" {
186-
return false
187-
}
188-
// See https://www.rfc-editor.org/rfc/rfc9110#section-5.6.2.
189-
for _, r := range s {
190-
if !unicode.IsLetter(r) && !unicode.IsDigit(r) && !strings.ContainsRune("!#$%&'*+.^_`|~-", r) {
191-
return false
192-
}
193-
}
194-
return true
195-
}
196-
197183
func isValidWildcardName(s string) bool {
198184
if s == "" {
199185
return false

‎src/net/http/pattern_test.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,6 @@ func (p1 *pattern) equal(p2 *pattern) bool {
145145
slices.Equal(p1.segments, p2.segments)
146146
}
147147

148-
func TestIsValidHTTPToken(t *testing.T) {
149-
for _, test := range []struct {
150-
in string
151-
want bool
152-
}{
153-
{"", false},
154-
{"GET", true},
155-
{"get", true},
156-
{"white space", false},
157-
{"#!~", true},
158-
{"a-b1_2", true},
159-
{"notok)", false},
160-
} {
161-
got := isValidHTTPToken(test.in)
162-
if g, w := got, test.want; g != w {
163-
t.Errorf("%q: got %t, want %t", test.in, g, w)
164-
}
165-
}
166-
}
167-
168148
func mustParsePattern(tb testing.TB, s string) *pattern {
169149
tb.Helper()
170150
p, err := parsePattern(s)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /