From 340a021daf1fa9f4f3bb75ff3a722c3caa9e4f20 Mon Sep 17 00:00:00 2001 From: gzdaijie Date: Mon, 3 Feb 2020 00:45:50 +0800 Subject: [PATCH] fix lru Value comments --- gee-cache/day1-lru/geecache/lru/lru.go | 5 ++--- gee-cache/day2-single-node/geecache/lru/lru.go | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) 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