We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i've added some example code below and i've found that the singleton is created twice.
c := container.New() c.Singleton(func() (ExampleService, error) { fmt.Println("singleton created") return CreateExampleService() })
the issue only occurs because the resolver function returns a 2-tuple of (ExampleService, error)
the issue is happening because of the invoke call happening in this loop (I think) https://github.com/golobby/container/blob/master/container.go#L101
The text was updated successfully, but these errors were encountered:
fix issue #37
2a190c9
fix issue #37 (#38)
5401218
Fix issue #37
Thanks @Place1 for reporting the bug. It must be fixed on: https://github.com/golobby/container/releases/tag/v3.1.7
Sorry, something went wrong.
miladrahimi
Successfully merging a pull request may close this issue.
i've added some example code below and i've found that the singleton is created twice.
the issue only occurs because the resolver function returns a 2-tuple of (ExampleService, error)
the issue is happening because of the invoke call happening in this loop (I think) https://github.com/golobby/container/blob/master/container.go#L101
The text was updated successfully, but these errors were encountered: