We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb9bf33 commit b93f18bCopy full SHA for b93f18b
1 file changed
README.md
@@ -51,6 +51,12 @@ The following snippet expresses singleton binding.
51
err := container.Singleton(func() Abstraction {
52
return Implementation
53
})
54
+
55
+// If you might return an error...
56
57
+err := container.Singleton(func() (Abstraction, error) {
58
+ return Implementation, nil
59
+})
60
```
61
62
It takes a resolver (function) whose return type is the abstraction and the function body returns the concrete (implementation).
0 commit comments