diff --git a/context/context.go b/context/context.go new file mode 100644 index 0000000..af2a83c --- /dev/null +++ b/context/context.go @@ -0,0 +1,7 @@ +package context + +type ContextKey string + +func (c ContextKey) String() string { + return string(c) +} diff --git a/net/converter/ip.go b/net/converter/ip.go index c5d846b..a70194c 100644 --- a/net/converter/ip.go +++ b/net/converter/ip.go @@ -20,10 +20,10 @@ func IPToUint64(ip string) uint64 { if !isV4 { return ipv6ToUint64(ip) } - return ipv4ToUint64(ip) + return IPV4ToUint64(ip) } -func ipv4ToUint64(s string) uint64 { +func IPV4ToUint64(s string) uint64 { bits := strings.Split(s, ".") b0, _ := strconv.Atoi(bits[0])