cmd: Remove go-flags

This commit is contained in:
Martin Polden
2020-09-05 11:40:26 +02:00
parent 702c1f1e23
commit 0caa5873b9
5 changed files with 78 additions and 55 deletions

View File

@ -4,8 +4,24 @@ import (
"fmt"
"net"
"testing"
"unsafe"
)
func TestCache(t *testing.T) {
c := NewCache(10)
for i := 0; i < 100; i++ {
ip := net.ParseIP(fmt.Sprintf("192.0.2.%d", i))
r := &Response{IP: ip}
fmt.Println(unsafe.Sizeof(r))
c.Set(ip, r)
}
fmt.Println(len(c.entries))
fmt.Println(len(c.keys))
}
func TestCacheCapacity(t *testing.T) {
var tests = []struct {
addCount, capacity, size int