mirror of
https://github.com/logos-messaging/go-multiaddr.git
synced 2026-01-07 15:33:08 +00:00
remove unneeded default case in switch
This commit is contained in:
parent
9547d0a06f
commit
7c39c5cfde
@ -72,8 +72,6 @@ func IsPublicAddr(a ma.Multiaddr) bool {
|
|||||||
switch c.Protocol().Code {
|
switch c.Protocol().Code {
|
||||||
case ma.P_IP6ZONE:
|
case ma.P_IP6ZONE:
|
||||||
return true
|
return true
|
||||||
default:
|
|
||||||
return false
|
|
||||||
case ma.P_IP4:
|
case ma.P_IP4:
|
||||||
ip := net.IP(c.RawValue())
|
ip := net.IP(c.RawValue())
|
||||||
isPublic = !inAddrRange(ip, Private4) && !inAddrRange(ip, Unroutable4)
|
isPublic = !inAddrRange(ip, Private4) && !inAddrRange(ip, Unroutable4)
|
||||||
@ -93,8 +91,6 @@ func IsPrivateAddr(a ma.Multiaddr) bool {
|
|||||||
switch c.Protocol().Code {
|
switch c.Protocol().Code {
|
||||||
case ma.P_IP6ZONE:
|
case ma.P_IP6ZONE:
|
||||||
return true
|
return true
|
||||||
default:
|
|
||||||
return false
|
|
||||||
case ma.P_IP4:
|
case ma.P_IP4:
|
||||||
isPrivate = inAddrRange(net.IP(c.RawValue()), Private4)
|
isPrivate = inAddrRange(net.IP(c.RawValue()), Private4)
|
||||||
case ma.P_IP6:
|
case ma.P_IP6:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user