Skip to content

Commit

Permalink
[Format] format code
Browse files Browse the repository at this point in the history
  • Loading branch information
qizhiwang committed May 6, 2021
1 parent 2543a1a commit 7529929
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
46 changes: 23 additions & 23 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ type Cache interface {
}

type baseCache struct {
clock Clock
size int
loaderExpireFunc LoaderExpireFunc
evictedFunc EvictedFunc
purgeVisitorFunc PurgeVisitorFunc
addedFunc AddedFunc
deserializeFunc DeserializeFunc
serializeFunc SerializeFunc
expiration *time.Duration
expireCheckInterval *time.Duration
mu sync.RWMutex
loadGroup Group
clock Clock
size int
loaderExpireFunc LoaderExpireFunc
evictedFunc EvictedFunc
purgeVisitorFunc PurgeVisitorFunc
addedFunc AddedFunc
deserializeFunc DeserializeFunc
serializeFunc SerializeFunc
expiration *time.Duration
expireCheckInterval *time.Duration
mu sync.RWMutex
loadGroup Group
*stats
}

Expand All @@ -59,17 +59,17 @@ type (
)

type CacheBuilder struct {
clock Clock
tp string
size int
loaderExpireFunc LoaderExpireFunc
evictedFunc EvictedFunc
purgeVisitorFunc PurgeVisitorFunc
addedFunc AddedFunc
expiration *time.Duration
expireCheckInterval *time.Duration
deserializeFunc DeserializeFunc
serializeFunc SerializeFunc
clock Clock
tp string
size int
loaderExpireFunc LoaderExpireFunc
evictedFunc EvictedFunc
purgeVisitorFunc PurgeVisitorFunc
addedFunc AddedFunc
expiration *time.Duration
expireCheckInterval *time.Duration
deserializeFunc DeserializeFunc
serializeFunc SerializeFunc
}

func New(size int) *CacheBuilder {
Expand Down
4 changes: 2 additions & 2 deletions examples/autoloading/autoloading_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ func main() {
gc := gcache.New(10).
LFU().
LoaderFunc(func(key interface{}) (interface{}, error) {
return fmt.Sprintf("%v-value", key), nil
}).
return fmt.Sprintf("%v-value", key), nil
}).
Build()

v, err := gc.Get("key")
Expand Down
2 changes: 1 addition & 1 deletion examples/expireinterval/expire_interval.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"
)

func main () {
func main() {
gc := gcache.New(10).
LRU().
EvictedFunc(func(key, value interface{}) {
Expand Down

0 comments on commit 7529929

Please sign in to comment.