]> Cypherpunks repositories - gostls13.git/commitdiff
net/netip: add missing ) in ParsePrefix errors
authorsubham sarkar <sarkar.subhams2@gmail.com>
Wed, 8 Jun 2022 09:38:33 +0000 (15:08 +0530)
committerGopher Robot <gobot@golang.org>
Wed, 15 Jun 2022 20:07:10 +0000 (20:07 +0000)
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 <tobias.klauser@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Damien Neil <dneil@google.com>
src/net/netip/netip.go

index eae9c29ea717f8a2ea2da81b314fdb97a4bce4b7..bb83371a557d5a53ae77405e4f7fca9f910d36d4 100644 (file)
@@ -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
 }