From: Aleksandr Dobkinimg src=404 onerror=alert(document.domain) Date: Sat, 30 Apr 2022 04:02:43 +0000 (+0000) Subject: net/url: fix regex typo in comment in url.go X-Git-Tag: go1.19beta1~502 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fd6c556dc82253722a7f7b9f554a1892b0ede36e;p=gostls13.git net/url: fix regex typo in comment in url.go The original author almost certainly intended to match the literal dash character '-' but ended up matching a range of other characters instead. Change-Id: I7a0f67c5fdccd70b7ad58a882da851dfc22ce2f0 GitHub-Last-Rev: 76a39577e551328f707fd73b9ce85d20c121c555 GitHub-Pull-Request: golang/go#52627 Reviewed-on: https://go-review.googlesource.com/c/go/+/403076 Reviewed-by: Dmitri Shuralyov Reviewed-by: Ian Lance Taylor --- diff --git a/src/net/url/url.go b/src/net/url/url.go index 58b30411a4..db4d6385e3 100644 --- a/src/net/url/url.go +++ b/src/net/url/url.go @@ -428,7 +428,7 @@ func (u *Userinfo) String() string { } // Maybe rawURL is of the form scheme:path. -// (Scheme must be [a-zA-Z][a-zA-Z0-9+-.]*) +// (Scheme must be [a-zA-Z][a-zA-Z0-9+.-]*) // If so, return scheme, path; else return "", rawURL. func getScheme(rawURL string) (scheme, path string, err error) { for i := 0; i < len(rawURL); i++ {