Call to create a new singleton that is instantiated with the given init function. init is not called until the first invocation of Get(). If init errors, it will be called again on the next invocation of Get().
} s := NewSingleton(init) // Verify init hasn't been called yet c.Assert(callCount, Equals, 0)
NewSingleton is referenced in 1 repositorygithub.com/dropbox/godropbox
- 1 reference in singleton/singleton_test.go