Skip to content

Commit ed98219

Browse files
Update the example in the README.md file
1 parent 255c76e commit ed98219

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ type StringKey string
3232

3333
func (key StringKey) Hash() int {
3434
hash := fnv.New32()
35-
io.WriteString(hash, string(key))
35+
io.WriteString(hash, string(key)) // nolint: errcheck
3636

3737
return int(hash.Sum32())
3838
}
3939

40-
func (key StringKey) Equals(other interface{}) bool {
40+
func (key StringKey) Equals(other hashmap.Key) bool {
4141
return key == other.(StringKey)
4242
}
4343

@@ -48,10 +48,10 @@ const (
4848

4949
func main() {
5050
storage := hashmap.NewConcurrentHashMap()
51-
cleaner := gc.NewPartialGC(storage, time.Now)
51+
cleaner := gc.NewPartialGC(storage)
5252
go gc.Run(context.Background(), cleaner, gcPeriod)
5353

54-
timeZones := cache.NewCache(storage, time.Now)
54+
timeZones := cache.NewCache(cache.WithStorage(storage))
5555
timeZones.Set(StringKey("EST"), -5*60*60, exampleDelay/2)
5656
timeZones.Set(StringKey("CST"), -6*60*60, exampleDelay/2)
5757
timeZones.Set(StringKey("MST"), -7*60*60, exampleDelay/2)

0 commit comments

Comments
 (0)