]> Cypherpunks repositories - gostls13.git/commitdiff
net/netip: fix method name in {AddrPort,Prefix}.IsValid godoc
authorTobias Klauser <tklauser@distanz.ch>
Mon, 8 Aug 2022 15:14:14 +0000 (17:14 +0200)
committerGopher Robot <gobot@golang.org>
Tue, 9 Aug 2022 05:59:43 +0000 (05:59 +0000)
In CL 339309 these were probably copied from the respective
godoc comments in package inet.af/netaddr, also see
https://pkg.go.dev/inet.af/netaddr#IPPort.IsValid and
https://pkg.go.dev/inet.af/netaddr#IPPrefix.IsValid

In net/netip the methods are named Addr. Adjust the godoc comments
accordingly.

Change-Id: Icfe1d73b647c2e195d96cd5b1073a734905134af
Reviewed-on: https://go-review.googlesource.com/c/go/+/421995
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/net/netip/netip.go

index bb83371a557d5a53ae77405e4f7fca9f910d36d4..b5d55acdb36d1547b55ea65ce0249cec9cdc510c 100644 (file)
@@ -1114,7 +1114,7 @@ func MustParseAddrPort(s string) AddrPort {
 // isZero reports whether p is the zero AddrPort.
 func (p AddrPort) isZero() bool { return p == AddrPort{} }
 
-// IsValid reports whether p.IP() is valid.
+// IsValid reports whether p.Addr() is valid.
 // All ports are valid, including zero.
 func (p AddrPort) IsValid() bool { return p.ip.IsValid() }
 
@@ -1276,7 +1276,7 @@ func (p Prefix) Addr() Addr { return p.ip }
 // It reports -1 if invalid.
 func (p Prefix) Bits() int { return int(p.bits) }
 
-// IsValid reports whether p.Bits() has a valid range for p.IP().
+// IsValid reports whether p.Bits() has a valid range for p.Addr().
 // If p.Addr() is the zero Addr, IsValid returns false.
 // Note that if p is the zero Prefix, then p.IsValid() == false.
 func (p Prefix) IsValid() bool { return !p.ip.isZero() && p.bits >= 0 && int(p.bits) <= p.ip.BitLen() }