This commit is contained in:
crusader 2017-11-10 16:05:28 +09:00
parent f38e3a61af
commit cbe7492057
2 changed files with 9 additions and 2 deletions

7
context/context.go Normal file
View File

@ -0,0 +1,7 @@
package context
type ContextKey string
func (c ContextKey) String() string {
return string(c)
}

View File

@ -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])