fixed formatting
This commit is contained in:
@@ -20,7 +20,6 @@ func (b *LayeredBucket) get(primary, secondary string) *Item {
|
|||||||
return bucket.get(secondary)
|
return bucket.get(secondary)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (b *LayeredBucket) set(primary, secondary string, value interface{}, duration time.Duration) (*Item, bool) {
|
func (b *LayeredBucket) set(primary, secondary string, value interface{}, duration time.Duration) (*Item, bool) {
|
||||||
b.Lock()
|
b.Lock()
|
||||||
bucket, exists := b.buckets[primary]
|
bucket, exists := b.buckets[primary]
|
||||||
|
@@ -2,9 +2,9 @@ package ccache
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/karlseguin/expect"
|
. "github.com/karlseguin/expect"
|
||||||
|
"strconv"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
"strconv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type LayeredCacheTests struct{}
|
type LayeredCacheTests struct{}
|
||||||
@@ -51,7 +51,6 @@ func (l *LayeredCacheTests) DeletesAValue() {
|
|||||||
Expect(cache.Get("leto", "sister").(string)).To.Equal("ghanima")
|
Expect(cache.Get("leto", "sister").(string)).To.Equal("ghanima")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (l *LayeredCacheTests) DeletesALayer() {
|
func (l *LayeredCacheTests) DeletesALayer() {
|
||||||
cache := newLayered()
|
cache := newLayered()
|
||||||
cache.Set("spice", "flow", "value-a", time.Minute)
|
cache.Set("spice", "flow", "value-a", time.Minute)
|
||||||
@@ -64,10 +63,6 @@ func (l *LayeredCacheTests) DeletesALayer() {
|
|||||||
Expect(cache.Get("leto", "sister").(string)).To.Equal("ghanima")
|
Expect(cache.Get("leto", "sister").(string)).To.Equal("ghanima")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func (c *LayeredCacheTests) GCsTheOldestItems() {
|
func (c *LayeredCacheTests) GCsTheOldestItems() {
|
||||||
cache := Layered(Configure().ItemsToPrune(10))
|
cache := Layered(Configure().ItemsToPrune(10))
|
||||||
cache.Set("xx", "a", 23, time.Minute)
|
cache.Set("xx", "a", 23, time.Minute)
|
||||||
|
Reference in New Issue
Block a user