From fa19146038e0e94480c93d43e2a8306c419d5119 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 3 Nov 2021 16:18:36 +0100 Subject: [PATCH] net/netip: fix various typos in comments Change-Id: I67998f70969ac6e6ff1b52a56e49a61ef167ed50 Reviewed-on: https://go-review.googlesource.com/c/go/+/361055 Trust: Jason A. Donenfeld Run-TryBot: Jason A. Donenfeld TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- src/net/netip/netip.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net/netip/netip.go b/src/net/netip/netip.go index 4ef3b4bb68..d15a4947ac 100644 --- a/src/net/netip/netip.go +++ b/src/net/netip/netip.go @@ -4,7 +4,7 @@ // Package netip defines a IP address type that's a small value type. // Building on that Addr type, the package also defines AddrPort (an -// IP address and a port), and Prefix (a IP address and a bit length +// IP address and a port), and Prefix (an IP address and a bit length // prefix). // // Compared to the net.IP type, this package's Addr type takes less @@ -1184,7 +1184,7 @@ type Prefix struct { // bits is logically a uint8 (storing [0,128]) but also // encodes an "invalid" bit, currently represented by the // invalidPrefixBits sentinel value. It could be packed into - // the uint8 more with more comlicated expressions in the + // the uint8 more with more complicated expressions in the // accessors, but the extra byte (in padding anyway) doesn't // hurt and simplifies code below. bits int16 @@ -1195,7 +1195,7 @@ type Prefix struct { // public API. const invalidPrefixBits = -1 -// PrefixFrom returns an Prefix with the provided IP address and bit +// PrefixFrom returns a Prefix with the provided IP address and bit // prefix length. // // It does not allocate. Unlike Addr.Prefix, PrefixFrom does not mask @@ -1222,7 +1222,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 whether p.Bits() has a valid range for p.IP(). +// IsValid reports whether p.Bits() has a valid range for p.IP(). // 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() } -- 2.48.1