Update to go1.24.0

This commit is contained in:
Vorapol Rinsatitnon
2025-02-14 12:42:07 +07:00
parent 25e497e367
commit bf266cebe6
3169 changed files with 236789 additions and 60275 deletions

View File

@@ -13,6 +13,7 @@ package url
import (
"errors"
"fmt"
"maps"
"path"
"slices"
"strconv"
@@ -1004,12 +1005,7 @@ func (v Values) Encode() string {
return ""
}
var buf strings.Builder
keys := make([]string, 0, len(v))
for k := range v {
keys = append(keys, k)
}
slices.Sort(keys)
for _, k := range keys {
for _, k := range slices.Sorted(maps.Keys(v)) {
vs := v[k]
keyEscaped := QueryEscape(k)
for _, v := range vs {
@@ -1219,7 +1215,11 @@ func splitHostPort(hostPort string) (host, port string) {
// Would like to implement MarshalText/UnmarshalText but that will change the JSON representation of URLs.
func (u *URL) MarshalBinary() (text []byte, err error) {
return []byte(u.String()), nil
return u.AppendBinary(nil)
}
func (u *URL) AppendBinary(b []byte) ([]byte, error) {
return append(b, u.String()...), nil
}
func (u *URL) UnmarshalBinary(text []byte) error {