fixed formatting

This commit is contained in:
Karl Seguin
2014-10-25 12:21:10 +07:00
parent 0c7492b382
commit b0e3fca0f6
3 changed files with 3 additions and 9 deletions

View File

@@ -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]

View File

@@ -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)