func (fc *FCache) Clean(opts ...CleanOption) {
	// Lock the cache
	fc.Lock()
	defer fc.Unlock()

	// Process the options
	o := procCleanOpts(opts)

	// Clear the desired objects
	for _, idx := range fc.indexes {
		// Find the entries to remove
		toRemove := []interface{}{}
		for key, ent := range idx.entries {
			if ent.content == nil {
				if o.pending {
					ent.complete(&Entry{
						Error: context.Canceled,
					})
					toRemove = append(toRemove, key)
				}
			} else if o.objects && ent.content.Object != nil {
				toRemove = append(toRemove, key)
			} else if o.errors && ent.content.Error != nil {
				toRemove = append(toRemove, key)
			}
		}

		// Remove the entries
		for _, k := range toRemove {
			delete(idx.entries, k)
		}
	}
}
// Clean is used to clean things out of the cache.  The specific
// things to clean up are specified through the options passed in; if
// no options are passed in, the cache will be completely cleared.
Clean is used to clean things out of the cache.  The specific
things to clean up are specified through the options passed in; if
no options are passed in, the cache will be completely cleared.
// Clean is used to clean things out of the cache . The specific // things to clean up are specified through the options passed in ; if // no options are passed in the cache will be completely cleared .
func (fc *FCache) Clean(opts ...CleanOption) {
	fc.Lock()
	defer fc.Unlock()
	o := procCleanOpts(opts)
	for _, idx := range fc.indexes {
		toRemove := []interface{}{}
		for key, ent := range idx.entries {
			if ent.content == nil {
				if o.pending {
					ent.complete(&Entry{
						Error: context.Canceled,
					})
					toRemove = append(toRemove, key)
				}
			} else if o.objects && ent.content.Object != nil {
				toRemove = append(toRemove, key)
			} else if o.errors && ent.content.Error != nil {
				toRemove = append(toRemove, key)
			}
		}
		for _, k := range toRemove {
			delete(idx.entries, k)
		}
	}
}
func ( fc * FCache ) Clean ( opts ... CleanOption ) { fc . Lock ( ) defer fc . Unlock ( ) o := procCleanOpts ( opts ) for _ , idx := range fc . indexes { toRemove := [ ] interface { } { } for key , ent := range idx . entries { if ent . content == nil { if o . pending { ent . complete ( & Entry { Error : context . Canceled , } ) toRemove = append ( toRemove , key ) } } else if o . objects && ent . content . Object != nil { toRemove = append ( toRemove , key ) } else if o . errors && ent . content . Error != nil { toRemove = append ( toRemove , key ) } } for _ , k := range toRemove { delete ( idx . entries , k ) } } }
Clean is used to clean things out of the cache.
Clean is used to clean things out of the cache .
// Lock the cache // Process the options // Clear the desired objects // Find the entries to remove // Remove the entries