sm
/
cache
1
0
Fork 0

s/gob.Register/gob.Register()/ in NewFrom doc

This commit is contained in:
Patrick Mylund Nielsen 2014-12-22 02:30:02 -05:00
parent bc36de7dec
commit 873e78f0db
1 changed files with 4 additions and 4 deletions

View File

@ -1013,10 +1013,10 @@ func New(defaultExpiration, cleanupInterval time.Duration) *Cache {
// If need be, the map can be accessed at a later point using c.Items() (subject // If need be, the map can be accessed at a later point using c.Items() (subject
// to the same caveat.) // to the same caveat.)
// //
// Note regarding serialization: When using e.g. gob, make sure to gob.Register // Note regarding serialization: When using e.g. gob, make sure to
// the individual types stored in the cache before encoding a map retrieved with // gob.Register() the individual types stored in the cache before encoding a
// c.Items(), and to register those same types before decoding a blob containing // map retrieved with c.Items(), and to register those same types before
// an items map. // decoding a blob containing an items map.
func NewFrom(defaultExpiration, cleanupInterval time.Duration, items map[string]*Item) *Cache { func NewFrom(defaultExpiration, cleanupInterval time.Duration, items map[string]*Item) *Cache {
return newCacheWithJanitor(defaultExpiration, cleanupInterval, items) return newCacheWithJanitor(defaultExpiration, cleanupInterval, items)
} }