Update to go1.25.0

This commit is contained in:
Vorapol Rinsatitnon
2025-08-13 21:50:03 +07:00
parent 4fdddd398d
commit c7759f4edb
2303 changed files with 161699 additions and 70952 deletions

View File

@@ -3,12 +3,14 @@
// license that can be found in the LICENSE file.
// Package url parses URLs and implements query escaping.
//
// See RFC 3986. This package generally follows RFC 3986, except where
// it deviates for compatibility reasons.
// RFC 6874 followed for IPv6 zone literals.
package url
// See RFC 3986. This package generally follows RFC 3986, except where
// it deviates for compatibility reasons. When sending changes, first
// search old issues for history on decisions. Unit tests should also
// contain references to issue numbers with details.
// When sending changes, first search old issues for history on decisions.
// Unit tests should also contain references to issue numbers with details.
import (
"errors"
@@ -67,8 +69,9 @@ func unhex(c byte) byte {
return c - 'a' + 10
case 'A' <= c && c <= 'F':
return c - 'A' + 10
default:
panic("invalid hex character")
}
return 0
}
type encoding int
@@ -1277,7 +1280,18 @@ func validUserinfo(s string) bool {
}
switch r {
case '-', '.', '_', ':', '~', '!', '$', '&', '\'',
'(', ')', '*', '+', ',', ';', '=', '%', '@':
'(', ')', '*', '+', ',', ';', '=', '%':
continue
case '@':
// `RFC 3986 section 3.2.1` does not allow '@' in userinfo.
// It is a delimiter between userinfo and host.
// However, URLs are diverse, and in some cases,
// the userinfo may contain an '@' character,
// for example, in "http://username:p@ssword@google.com",
// the string "username:p@ssword" should be treated as valid userinfo.
// Ref:
// https://go.dev/issue/3439
// https://go.dev/issue/22655
continue
default:
return false