]> Cypherpunks repositories - gostls13.git/commitdiff
net/url: fix regex typo in comment in url.go
authorAleksandr Dobkinimg src=404 onerror=alert(document.domain) <dobkin@google.com>
Sat, 30 Apr 2022 04:02:43 +0000 (04:02 +0000)
committerDmitri Shuralyov <dmitshur@golang.org>
Sat, 30 Apr 2022 04:04:40 +0000 (04:04 +0000)
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 <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/net/url/url.go

index 58b30411a4c709b563a9b958e3532fd86a18fabe..db4d6385e334792257c78f8ad080ad73898eaea4 100644 (file)
@@ -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++ {