sm
/
cache
1
0
Fork 0

README.md: Remove one level of indentation and increase 'recommended' cleanupInterval

This commit is contained in:
Patrick Mylund Nielsen 2017-03-26 12:30:15 -04:00 committed by GitHub
parent e7a9def80f
commit dd1ed0ba63
1 changed files with 74 additions and 75 deletions

View File

@ -20,17 +20,16 @@ one) to recover from downtime quickly. (See the docs for `NewFrom()` for caveats
### Usage
```go
import (
import (
"fmt"
"github.com/patrickmn/go-cache"
"time"
)
func main() {
)
func main() {
// Create a cache with a default expiration time of 5 minutes, and which
// purges expired items every 30 seconds
c := cache.New(5*time.Minute, 30*time.Second)
// purges expired items every 10 minutes
c := cache.New(5*time.Minute, 10*time.Minute)
// Set the value of the key "foo" to "bar", with the default expiration time
c.Set("foo", "bar", cache.DefaultExpiration)
@ -99,7 +98,7 @@ one) to recover from downtime quickly. (See the docs for `NewFrom()` for caveats
// 1
// 2
}
}
```
### Reference