diff --git a/README.md b/README.md index c5789cc..dff50f6 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,18 @@ import ( "time" ) +func initapp() { + // be sure to register your custom types before calling .CacheFrom() + gob.Register(MyStruct) + gob.Register(MyStruct2) +} + func main() { + + // only needed if you are loading to/from external storage + // with .Items() and .CacheFrom() + initapp() + // Create a cache with a default expiration time of 5 minutes, and which // purges expired items every 10 minutes c := cache.New(5*time.Minute, 10*time.Minute)