diff --git a/CHANGELOG.md b/CHANGELOG.md index 903ab5a..a148bc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,15 @@ Nothing yet! -## [v2.0.0] - 2024-03-04 +## [v2.0.1] - 2024-03-04 +- Changed name of module to `github.com/derision-test/go-mockgen/v2`. - Updated module to Go 1.22. [#52](https://github.com/derision-test/go-mockgen/pull/52) +## v2.0.0 - 2024-03-04 + +**PULLED**, as module name was not updated properly. + ## [v1.3.7] - 2022-11-11 - Fixed import cycle generated by generic param referencing local type. [#39](https://github.com/derision-test/go-mockgen/pull/39) @@ -114,3 +119,4 @@ No significant changes (only corrected version output). [v1.3.5]: https://github.com/derision-test/go-mockgen/compare/v1.3.4...v1.3.5 [v1.3.6]: https://github.com/derision-test/go-mockgen/compare/v1.3.5...v1.3.6 [v1.3.7]: https://github.com/derision-test/go-mockgen/compare/v1.3.6...v1.3.7 +[v2.0.1]: https://github.com/derision-test/go-mockgen/compare/v1.3.7...v2.0.1 diff --git a/README.md b/README.md index 52131e5..e932549 100644 --- a/README.md +++ b/README.md @@ -173,8 +173,8 @@ To use the assertions, import the assert and require packages by name. ```go import ( - mockassert "github.com/derision-test/go-mockgen/testutil/assert" - mockrequire "github.com/derision-test/go-mockgen/testutil/require" + mockassert "github.com/derision-test/go-mockgen/v2/testutil/assert" + mockrequire "github.com/derision-test/go-mockgen/v2/testutil/require" ) ``` @@ -210,7 +210,7 @@ This library also contains a set of [Gomega](https://onsi.github.io/gomega/) mat To use the matchers, import the matchers package anonymously. ```go -import . "github.com/derision-test/go-mockgen/testutil/gomega" +import . "github.com/derision-test/go-mockgen/v2/testutil/gomega" ``` The following matchers are defined. diff --git a/cmd/go-mockgen/args.go b/cmd/go-mockgen/args.go index 117d7aa..c8dcc90 100644 --- a/cmd/go-mockgen/args.go +++ b/cmd/go-mockgen/args.go @@ -9,9 +9,9 @@ import ( "strings" "github.com/alecthomas/kingpin" - "github.com/derision-test/go-mockgen/internal/mockgen/consts" - "github.com/derision-test/go-mockgen/internal/mockgen/generation" - "github.com/derision-test/go-mockgen/internal/mockgen/paths" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/consts" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/generation" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/paths" "gopkg.in/yaml.v3" ) diff --git a/cmd/go-mockgen/main.go b/cmd/go-mockgen/main.go index 118dbc9..b4166d1 100644 --- a/cmd/go-mockgen/main.go +++ b/cmd/go-mockgen/main.go @@ -5,8 +5,8 @@ import ( "log" "strings" - "github.com/derision-test/go-mockgen/internal/mockgen/generation" - "github.com/derision-test/go-mockgen/internal/mockgen/types" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/generation" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/types" "golang.org/x/tools/go/packages" ) diff --git a/go.mod b/go.mod index 50204fd..a7ee4ab 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/derision-test/go-mockgen +module github.com/derision-test/go-mockgen/v2 go 1.22 diff --git a/internal/integration/gomega_test.go b/internal/integration/gomega_test.go index 284b18a..b70f0dc 100644 --- a/internal/integration/gomega_test.go +++ b/internal/integration/gomega_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/derision-test/go-mockgen/internal/integration/testdata" - "github.com/derision-test/go-mockgen/internal/integration/testdata/mocks" - . "github.com/derision-test/go-mockgen/testutil/gomega" + "github.com/derision-test/go-mockgen/v2/internal/integration/testdata" + "github.com/derision-test/go-mockgen/v2/internal/integration/testdata/mocks" + . "github.com/derision-test/go-mockgen/v2/testutil/gomega" . "github.com/onsi/gomega" ) diff --git a/internal/integration/strict_test.go b/internal/integration/strict_test.go index 8ceb8a5..90273e7 100644 --- a/internal/integration/strict_test.go +++ b/internal/integration/strict_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/derision-test/go-mockgen/internal/integration/testdata/mocks" + "github.com/derision-test/go-mockgen/v2/internal/integration/testdata/mocks" "github.com/stretchr/testify/assert" ) diff --git a/internal/integration/testify_test.go b/internal/integration/testify_test.go index 16bac2e..e5f7f33 100644 --- a/internal/integration/testify_test.go +++ b/internal/integration/testify_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "github.com/derision-test/go-mockgen/internal/integration/testdata" - "github.com/derision-test/go-mockgen/internal/integration/testdata/mocks" - mockassert "github.com/derision-test/go-mockgen/testutil/assert" + "github.com/derision-test/go-mockgen/v2/internal/integration/testdata" + "github.com/derision-test/go-mockgen/v2/internal/integration/testdata/mocks" + mockassert "github.com/derision-test/go-mockgen/v2/testutil/assert" "github.com/stretchr/testify/assert" ) diff --git a/internal/mockgen/consts/consts.go b/internal/mockgen/consts/consts.go index fc6e346..6c9843b 100644 --- a/internal/mockgen/consts/consts.go +++ b/internal/mockgen/consts/consts.go @@ -2,7 +2,7 @@ package consts const ( Name = "go-mockgen" - PackageName = "github.com/derision-test/go-mockgen" + PackageName = "github.com/derision-test/go-mockgen/v2" Description = "go-mockgen generates mock implementations from interface definitions." Version = "1.3.7" ) diff --git a/internal/mockgen/generation/generate.go b/internal/mockgen/generation/generate.go index bbfb238..bdb0931 100644 --- a/internal/mockgen/generation/generate.go +++ b/internal/mockgen/generation/generate.go @@ -11,9 +11,9 @@ import ( "strings" "github.com/dave/jennifer/jen" - "github.com/derision-test/go-mockgen/internal/mockgen/consts" - "github.com/derision-test/go-mockgen/internal/mockgen/paths" - "github.com/derision-test/go-mockgen/internal/mockgen/types" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/consts" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/paths" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/types" ) type Options struct { diff --git a/internal/mockgen/generation/generate_constructors.go b/internal/mockgen/generation/generate_constructors.go index 9a1c1fb..22db4d7 100644 --- a/internal/mockgen/generation/generate_constructors.go +++ b/internal/mockgen/generation/generate_constructors.go @@ -6,7 +6,7 @@ import ( "unicode" "github.com/dave/jennifer/jen" - "github.com/derision-test/go-mockgen/internal/mockgen/types" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/types" ) func generateMockStructConstructor(iface *wrappedInterface, constructorPrefix, outputImportPath string) jen.Code { diff --git a/internal/mockgen/generation/generate_constructors_test.go b/internal/mockgen/generation/generate_constructors_test.go index d916c98..6f9654d 100644 --- a/internal/mockgen/generation/generate_constructors_test.go +++ b/internal/mockgen/generation/generate_constructors_test.go @@ -92,8 +92,8 @@ func TestGenerateMockStructFromConstructorUnexported(t *testing.T) { expected := strip(` // surrogateMockClient is a copy of the client interface (from the package - // github.com/derision-test/go-mockgen/test). It is redefined here as it is - // unexported in the source package. + // github.com/derision-test/go-mockgen/v2/test). It is redefined here as it + // is unexported in the source package. type surrogateMockClient interface { Status() (string, bool) Do(string) bool diff --git a/internal/mockgen/generation/generate_structs.go b/internal/mockgen/generation/generate_structs.go index 81b2595..0fb23cb 100644 --- a/internal/mockgen/generation/generate_structs.go +++ b/internal/mockgen/generation/generate_structs.go @@ -5,7 +5,7 @@ import ( "strconv" "github.com/dave/jennifer/jen" - "github.com/derision-test/go-mockgen/internal/mockgen/types" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/types" "github.com/dustin/go-humanize" ) diff --git a/internal/mockgen/generation/generate_structs_test.go b/internal/mockgen/generation/generate_structs_test.go index 46a2848..a8eafb1 100644 --- a/internal/mockgen/generation/generate_structs_test.go +++ b/internal/mockgen/generation/generate_structs_test.go @@ -11,7 +11,8 @@ func TestGenerateMockStruct(t *testing.T) { code := generateMockStruct(makeInterface(TestMethodStatus, TestMethodDo, TestMethodDof), "") expected := strip(` // MockTestClient is a mock implementation of the Client interface (from the - // package github.com/derision-test/go-mockgen/test) used for unit testing. + // package github.com/derision-test/go-mockgen/v2/test) used for unit + // testing. type MockTestClient struct { // StatusFunc is an instance of a mock function object controlling the // behavior of the method Status. diff --git a/internal/mockgen/generation/helpers_test.go b/internal/mockgen/generation/helpers_test.go index 8141b38..c6e690c 100644 --- a/internal/mockgen/generation/helpers_test.go +++ b/internal/mockgen/generation/helpers_test.go @@ -4,14 +4,14 @@ import ( gotypes "go/types" "strings" - "github.com/derision-test/go-mockgen/internal/mockgen/types" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/types" ) const ( TestPrefix = "Test" TestTitleName = "Client" TestMockStructName = "MockTestClient" - TestImportPath = "github.com/derision-test/go-mockgen/test" + TestImportPath = "github.com/derision-test/go-mockgen/v2/test" ) var ( diff --git a/internal/mockgen/generation/util.go b/internal/mockgen/generation/util.go index 2d05c45..352dd78 100644 --- a/internal/mockgen/generation/util.go +++ b/internal/mockgen/generation/util.go @@ -2,7 +2,7 @@ package generation import ( "github.com/dave/jennifer/jen" - "github.com/derision-test/go-mockgen/internal/mockgen/types" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/types" ) func compose(stmt *jen.Statement, tail ...jen.Code) *jen.Statement { diff --git a/internal/mockgen/generation/wrapped_interface.go b/internal/mockgen/generation/wrapped_interface.go index 5670ded..470e4c8 100644 --- a/internal/mockgen/generation/wrapped_interface.go +++ b/internal/mockgen/generation/wrapped_interface.go @@ -1,6 +1,6 @@ package generation -import "github.com/derision-test/go-mockgen/internal/mockgen/types" +import "github.com/derision-test/go-mockgen/v2/internal/mockgen/types" type wrappedInterface struct { *types.Interface diff --git a/internal/mockgen/generation/wrapped_method.go b/internal/mockgen/generation/wrapped_method.go index d2e5bb5..24e0f70 100644 --- a/internal/mockgen/generation/wrapped_method.go +++ b/internal/mockgen/generation/wrapped_method.go @@ -2,7 +2,7 @@ package generation import ( "github.com/dave/jennifer/jen" - "github.com/derision-test/go-mockgen/internal/mockgen/types" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/types" ) type wrappedMethod struct { diff --git a/internal/mockgen/types/extract.go b/internal/mockgen/types/extract.go index 9b3ebf6..f182198 100644 --- a/internal/mockgen/types/extract.go +++ b/internal/mockgen/types/extract.go @@ -9,7 +9,7 @@ import ( "strings" "unicode" - "github.com/derision-test/go-mockgen/internal/mockgen/paths" + "github.com/derision-test/go-mockgen/v2/internal/mockgen/paths" "golang.org/x/tools/go/packages" ) diff --git a/testutil/assert/asserter.go b/testutil/assert/asserter.go index 33274f5..deae193 100644 --- a/testutil/assert/asserter.go +++ b/testutil/assert/asserter.go @@ -3,7 +3,7 @@ package mockassert import ( "reflect" - "github.com/derision-test/go-mockgen/internal/testutil" + "github.com/derision-test/go-mockgen/v2/internal/testutil" "github.com/stretchr/testify/assert" ) diff --git a/testutil/assert/assertions.go b/testutil/assert/assertions.go index dffaff2..37fd76f 100644 --- a/testutil/assert/assertions.go +++ b/testutil/assert/assertions.go @@ -3,7 +3,7 @@ package mockassert import ( "fmt" - "github.com/derision-test/go-mockgen/internal/testutil" + "github.com/derision-test/go-mockgen/v2/internal/testutil" "github.com/stretchr/testify/assert" ) diff --git a/testutil/gomega/called_matcher.go b/testutil/gomega/called_matcher.go index 5519565..f5b3d55 100644 --- a/testutil/gomega/called_matcher.go +++ b/testutil/gomega/called_matcher.go @@ -3,7 +3,7 @@ package matchers import ( "fmt" - "github.com/derision-test/go-mockgen/internal/testutil" + "github.com/derision-test/go-mockgen/v2/internal/testutil" "github.com/onsi/gomega/format" "github.com/onsi/gomega/types" ) diff --git a/testutil/gomega/called_with_matcher.go b/testutil/gomega/called_with_matcher.go index 62e6270..65cdc13 100644 --- a/testutil/gomega/called_with_matcher.go +++ b/testutil/gomega/called_with_matcher.go @@ -3,7 +3,7 @@ package matchers import ( "fmt" - "github.com/derision-test/go-mockgen/internal/testutil" + "github.com/derision-test/go-mockgen/v2/internal/testutil" "github.com/onsi/gomega/format" "github.com/onsi/gomega/matchers" "github.com/onsi/gomega/types" diff --git a/testutil/require/asserter.go b/testutil/require/asserter.go index a7cb36e..d54b1e9 100644 --- a/testutil/require/asserter.go +++ b/testutil/require/asserter.go @@ -1,6 +1,6 @@ package mockrequire -import mockassert "github.com/derision-test/go-mockgen/testutil/assert" +import mockassert "github.com/derision-test/go-mockgen/v2/testutil/assert" type CallInstanceAsserter = mockassert.CallInstanceAsserter type CallInstanceAsserterFunc = mockassert.CallInstanceAsserterFunc diff --git a/testutil/require/require.go b/testutil/require/require.go index d3658ad..ee18586 100644 --- a/testutil/require/require.go +++ b/testutil/require/require.go @@ -1,7 +1,7 @@ package mockrequire import ( - mockassert "github.com/derision-test/go-mockgen/testutil/assert" + mockassert "github.com/derision-test/go-mockgen/v2/testutil/assert" "github.com/stretchr/testify/require" )