| 31 | } |
| 32 | |
| 33 | type singletonImpl struct { |
| 34 | sync.Mutex |
| 35 | |
| 36 | // The actual singleton object |
| 37 | data interface{} |
| 38 | // Constructor for the singleton object |
| 39 | init SingletonInitFunc |
| 40 | // Non-zero if init was run without error |
| 41 | initialized int32 |
| 42 | } |
| 43 | |
| 44 | func (s *singletonImpl) Get() (interface{}, error) { |
| 45 | // Don't lock in the common case |
nothing calls this directly
no outgoing calls
no test coverage detected