From cbe7492057ef6881f6e47038dd3bd2665ee395a4 Mon Sep 17 00:00:00 2001 From: crusader Date: Fri, 10 Nov 2017 16:05:28 +0900 Subject: [PATCH] ing --- context/context.go | 7 +++++++ net/converter/ip.go | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 context/context.go 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])