func (c *cache) Save(w io.Writer) (err error) {
	enc := gob.NewEncoder(w)
	defer func() {
		if x := recover(); x != nil {
			err = fmt.Errorf("Error registering item types with Gob library")
		}
	}()
	c.mu.RLock()
	defer c.mu.RUnlock()
	for _, v := range c.items {
		gob.Register(v.Object)
	}
	err = enc.Encode(&c.items)
	return
}
func (c *cache) Save(w io.Writer) (err error) {
	enc := gob.NewEncoder(w)
	defer func() {
		if x := recover(); x != nil {
			err = fmt.Errorf("Error registering item types with Gob library")
		}
	}()
	c.mu.RLock()
	defer c.mu.RUnlock()
	for _, v := range c.items {
		gob.Register(v.Object)
	}
	err = enc.Encode(&c.items)
	return
}
func ( c * cache ) Save ( w io . Writer ) ( err error ) { enc := gob . NewEncoder ( w ) defer func ( ) { if x := recover ( ) ; x != nil { err = fmt . Errorf ( " " ) } } ( ) c . mu . RLock ( ) defer c . mu . RUnlock ( ) for _ , v := range c . items { gob . Register ( v . Object ) } err = enc . Encode ( & c . items ) return }
// Write the cache's items (using Gob) to an io.Writer.
//
// NOTE: This method is deprecated in favor of c.Items() and NewFrom() (see the
// documentation for NewFrom().)
Write the cache s items ( using Gob ) to an io . Writer . NOTE : This method is deprecated in favor of c . Items () and NewFrom () ( see the documentation for NewFrom () . )