Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# nject - dependency injection

[![Stability: Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html)
[![GoDoc](https://godoc.org/github.com/muir/nject?status.png)](https://pkg.go.dev/github.com/muir/nject)
[![GoDoc](https://godoc.org/github.com/muir/nject?status.png)](https://pkg.go.dev/github.com/muir/nject/v2)
![unit tests](https://github.com/muir/nject/actions/workflows/go.yml/badge.svg)
[![report card](https://goreportcard.com/badge/github.com/muir/nject)](https://goreportcard.com/report/github.com/muir/nject)
[![codecov](https://codecov.io/gh/muir/nject/branch/main/graph/badge.svg)](https://codecov.io/gh/muir/nject)

Install:

go get github.com/muir/nject
go get github.com/muir/nject/v2

---

Expand Down
2 changes: 1 addition & 1 deletion condense_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/muir/nject"
"github.com/muir/nject/v2"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion example_allow_shadowing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

func ExampleAllowReturnShadowing() {
Expand Down
2 changes: 1 addition & 1 deletion example_bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// Bind does as much work before invoke as possible.
Expand Down
2 changes: 1 addition & 1 deletion example_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

func ExampleCluster() {
Expand Down
2 changes: 1 addition & 1 deletion example_collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

func ExampleSequence() {
Expand Down
2 changes: 1 addition & 1 deletion example_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"errors"
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// InjectDB injects both an *sql.DB and an *sql.Tx if they're needed.
Expand Down
2 changes: 1 addition & 1 deletion example_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"reflect"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// ExampleGeneratedFromInjectionChain demonstrates how a special
Expand Down
2 changes: 1 addition & 1 deletion example_memoize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// Memoize implies Chacheable. To make sure that Memoize can actually function
Expand Down
2 changes: 1 addition & 1 deletion example_methodcall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

type S struct {
Expand Down
2 changes: 1 addition & 1 deletion example_must_consume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"database/sql"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion example_postaction2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

type Causer interface {
Expand Down
2 changes: 1 addition & 1 deletion example_postaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

func ExamplePostActionByTag() {
Expand Down
2 changes: 1 addition & 1 deletion example_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strconv"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// Provide does one job: it names an otherwise anonymous
Expand Down
2 changes: 1 addition & 1 deletion example_reorder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// This demonstrates how it to have a default that gets overridden by
Expand Down
2 changes: 1 addition & 1 deletion example_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// Run is the simplest way to use the nject framework.
Expand Down
2 changes: 1 addition & 1 deletion example_setcallback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// SetCallback invokes a function passing a function that
Expand Down
2 changes: 1 addition & 1 deletion example_singleton_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"fmt"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// Singleton providers get run only once even if their arguments are different.
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/muir/nject"
"github.com/muir/nject/v2"
)

// Example shows what gets included and what does not for several injection chains.
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/muir/nject
module github.com/muir/nject/v2

go 1.18

Expand All @@ -9,9 +9,7 @@ require (

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
8 changes: 1 addition & 7 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/muir/reflectutils v0.11.0 h1:h3rJpAq3KcKh65DLcrFgkzXdpmTHNOX66ar8/VQGrRg=
github.com/muir/reflectutils v0.11.0/go.mod h1:q/NHh230BgwnQX3fO3ooroT9c5y6Ymo44AEUnLPwYhc=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand All @@ -13,8 +8,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
12 changes: 7 additions & 5 deletions matrix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package nject_test
import (
"testing"

"github.com/muir/nject"
"github.com/muir/nject/v2"
"github.com/stretchr/testify/assert"
)

type PT01 string
type PT02 string
type PT03 string
type PT04 string
type (
PT01 string
PT02 string
PT03 string
PT04 string
)

func TestParallelCallsToInner(t *testing.T) {
t.Parallel()
Expand Down
2 changes: 1 addition & 1 deletion replace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strconv"
"testing"

"github.com/muir/nject"
"github.com/muir/nject/v2"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion shadowing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nject_test
import (
"testing"

"github.com/muir/nject"
"github.com/muir/nject/v2"
"github.com/stretchr/testify/require"
)

Expand Down
Loading