diff --git a/README.md b/README.md index bb96205..f88f011 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Go Reference](https://pkg.go.dev/badge/github.com/Ompluscator/genjector.svg)](https://pkg.go.dev/github.com/Ompluscator/genjector) + # Package Genjector Reflection-free Run-Time Dependency Injection framework for Go 1.18+ diff --git a/examples/provider_test.go b/examples/provider_test.go index f91cc56..fd06687 100644 --- a/examples/provider_test.go +++ b/examples/provider_test.go @@ -54,6 +54,9 @@ func TestAsProvider(t *testing.T) { value: "value provided inside the ProviderMethod", }, nil })) + if err != nil { + t.Error("binding should not cause an error") + } instance, err := genjector.NewInstance[*ProviderStruct]() if err != nil { diff --git a/injection.go b/injection.go index 53f0ef3..3d7ead4 100644 --- a/injection.go +++ b/injection.go @@ -40,7 +40,7 @@ type Binding interface { } // BindingSource represents an interface that delivers starting Key and -// Binding instances, that later could be overriden by KeyOption or +// Binding instances, that later could be overridden by KeyOption or // BindingOption. type BindingSource[T any] interface { Key() Key @@ -118,7 +118,7 @@ func Bind[T any](source BindingSource[T], options ...BindingOption) error { return nil } -// MustBind wraps Bind method, by making sure error is not returned as an arguement. +// MustBind wraps Bind method, by making sure error is not returned as an argument. // // Still, in case of error, it panics. func MustBind[T any](source BindingSource[T], options ...BindingOption) { @@ -175,7 +175,7 @@ func NewInstance[T any](options ...KeyOption) (T, error) { return result, nil } -// MustNewInstance wraps NewInstance method, by making sure error is not returned as an arguement. +// MustNewInstance wraps NewInstance method, by making sure error is not returned as an argument. // // Still, in case of error, it panics. func MustNewInstance[T any](options ...KeyOption) T {