MCPcopy Create free account
hub / github.com/codnect/procyon / ContainsSingleton

Method ContainsSingleton

component/container.go:217–223  ·  view source on GitHub ↗

ContainsSingleton checks whether a singleton with the specified name exists.

(name string)

Source from the content-addressed store, hash-verified

215
216// ContainsSingleton checks whether a singleton with the specified name exists.
217func (d *DefaultContainer) ContainsSingleton(name string) bool {
218 d.muSingletons.Lock()
219 defer d.muSingletons.Unlock()
220
221 _, exists := d.singletons[name]
222 return exists
223}
224
225// Singleton retrieves the singleton instance associated with the given name.
226// Returns the instance and a boolean indicating its existence.

Calls

no outgoing calls

Tested by 1