From: subham sarkar Date: Wed, 8 Jun 2022 09:38:33 +0000 (+0530) Subject: net/netip: add missing ) in ParsePrefix errors X-Git-Tag: go1.19rc1~119 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=937fa5000a7bb07ed62d35a1aea9ea0819659084;p=gostls13.git net/netip: add missing ) in ParsePrefix errors The existing error messages didn't add right parenthesis ')' properly leading to improper formation of error messages. Fixes #53283 Change-Id: Iadf9b8059403efa07e39716a81fab68cd10b7f87 Reviewed-on: https://go-review.googlesource.com/c/go/+/411015 Auto-Submit: Tobias Klauser TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Run-TryBot: Tobias Klauser Run-TryBot: Ian Lance Taylor Reviewed-by: Tobias Klauser Reviewed-by: Damien Neil --- diff --git a/src/net/netip/netip.go b/src/net/netip/netip.go index eae9c29ea7..bb83371a55 100644 --- a/src/net/netip/netip.go +++ b/src/net/netip/netip.go @@ -1310,14 +1310,14 @@ func ParsePrefix(s string) (Prefix, error) { bitsStr := s[i+1:] bits, err := strconv.Atoi(bitsStr) if err != nil { - return Prefix{}, errors.New("netip.ParsePrefix(" + strconv.Quote(s) + ": bad bits after slash: " + strconv.Quote(bitsStr)) + return Prefix{}, errors.New("netip.ParsePrefix(" + strconv.Quote(s) + "): bad bits after slash: " + strconv.Quote(bitsStr)) } maxBits := 32 if ip.Is6() { maxBits = 128 } if bits < 0 || bits > maxBits { - return Prefix{}, errors.New("netip.ParsePrefix(" + strconv.Quote(s) + ": prefix length out of range") + return Prefix{}, errors.New("netip.ParsePrefix(" + strconv.Quote(s) + "): prefix length out of range") } return PrefixFrom(ip, bits), nil }