mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
types/ipproto: drop IPProto from IPProtoVersion
Based on https://github.com/golang/go/wiki/CodeReviewComments#package-names. Updates #cleanup Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -6,23 +6,23 @@ package ipproto
|
||||
|
||||
import "fmt"
|
||||
|
||||
// IPProtoVersion describes the IP address version.
|
||||
type IPProtoVersion uint8
|
||||
// Version describes the IP address version.
|
||||
type Version uint8
|
||||
|
||||
// Valid IPProtoVersion values.
|
||||
// Valid Version values.
|
||||
const (
|
||||
IPProtoVersion4 = 4
|
||||
IPProtoVersion6 = 6
|
||||
Version4 = 4
|
||||
Version6 = 6
|
||||
)
|
||||
|
||||
func (p IPProtoVersion) String() string {
|
||||
func (p Version) String() string {
|
||||
switch p {
|
||||
case IPProtoVersion4:
|
||||
case Version4:
|
||||
return "IPv4"
|
||||
case IPProtoVersion6:
|
||||
case Version6:
|
||||
return "IPv6"
|
||||
default:
|
||||
return fmt.Sprintf("IPProtoVersion-%d", int(p))
|
||||
return fmt.Sprintf("Version-%d", int(p))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user