diff --git a/gee-cache/day1-lru/geecache/lru/lru.go b/gee-cache/day1-lru/geecache/lru/lru.go index 906c9da..81eee43 100644 --- a/gee-cache/day1-lru/geecache/lru/lru.go +++ b/gee-cache/day1-lru/geecache/lru/lru.go @@ -17,10 +17,9 @@ type entry struct { value Value } -// Value is optional interface for the value -// if it's not implemented, use unsafe.Sizeof to count +// Value use Len to count how many bytes it takes type Value interface { - Len() int // count how many bytes it takes + Len() int } // New is the Constructor of Cache diff --git a/gee-cache/day2-single-node/geecache/lru/lru.go b/gee-cache/day2-single-node/geecache/lru/lru.go index 906c9da..81eee43 100644 --- a/gee-cache/day2-single-node/geecache/lru/lru.go +++ b/gee-cache/day2-single-node/geecache/lru/lru.go @@ -17,10 +17,9 @@ type entry struct { value Value } -// Value is optional interface for the value -// if it's not implemented, use unsafe.Sizeof to count +// Value use Len to count how many bytes it takes type Value interface { - Len() int // count how many bytes it takes + Len() int } // New is the Constructor of Cache