// Close is used to indicate that wrapper returned by Cache.Get() is no
// longer needed by the caller of Cache.Get().  Since Wrappers are cached
// there may be other users.  The underlying listener is stopped when the
// number of active users reaches zero.
Close is used to indicate that wrapper returned by Cache.Get() is no
longer needed by the caller of Cache.Get().  Since Wrappers are cached
there may be other users.  The underlying listener is stopped when the
number of active users reaches zero.
// Close is used to indicate that wrapper returned by Cache . Get () is no // longer needed by the caller of Cache . Get () . Since Wrappers are cached // there may be other users . The underlying listener is stopped when the // number of active users reaches zero .
func (w *Wrapper) Close() error {
	w.lock.Lock()
	defer w.lock.Unlock()
	var err error
	if users == 1 {
		cache.lock.Lock()
		defer cache.lock.Unlock()
		delete(cache.cache, w.addr)
		err = w.listener.Close()
	}
	w.users--
	return err
}
func ( w * Wrapper ) Close ( ) error { w . lock . Lock ( ) defer w . lock . Unlock ( ) var err error if users == 1 { cache . lock . Lock ( ) defer cache . lock . Unlock ( ) delete ( cache . cache , w . addr ) err = w . listener . Close ( ) } w . users -- return err }
Close is used to indicate that wrapper returned by Cache.Get() is no
longer needed by the caller of Cache.Get().
Close is used to indicate that wrapper returned by Cache . Get () is no longer needed by the caller of Cache . Get () .