-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
The documentation for Prefix.Bits
says:
Bits returns p's prefix length.
It reports -1 if invalid.
The documentation for Prefix.IsValid
says:
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.
Thus, we expect the zero Prefix
to be invalid, but also report -1 bits.
Instead, we get 0 bits.
https://go.dev/play/p/rsc2Uy_jMX1
Either the behavior or the documentation should be adjusted.
\cc @bradfitz @josharian
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.