Skip to content

Commit bcc4fe9

Browse files
committed
Fixing module import path for v2
This fixes vektra#299
1 parent f5c2484 commit bcc4fe9

25 files changed

+60
-38
lines changed

Diff for: .goreleaser.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ before:
66
builds:
77
- main: ./main.go
88
ldflags:
9-
- -s -w -X github.com/vektra/mockery/pkg/config.SemVer={{.Version}}
9+
- -s -w -X github.com/vektra/mockery/v2/pkg/config.SemVer={{.Version}}
1010
env:
1111
- CGO_ENABLED=0
1212
goos:

Diff for: cmd/mockery.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import (
1717
"github.com/rs/zerolog/log"
1818
"github.com/spf13/cobra"
1919
"github.com/spf13/viper"
20-
"github.com/vektra/mockery/pkg"
21-
"github.com/vektra/mockery/pkg/config"
22-
"github.com/vektra/mockery/pkg/logging"
20+
"github.com/vektra/mockery/v2/pkg"
21+
"github.com/vektra/mockery/v2/pkg/config"
22+
"github.com/vektra/mockery/v2/pkg/logging"
2323
"golang.org/x/crypto/ssh/terminal"
2424
"golang.org/x/tools/go/packages"
2525
)

Diff for: cmd/showconfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/pkg/errors"
77
"github.com/spf13/cobra"
88
"github.com/spf13/viper"
9-
"github.com/vektra/mockery/pkg/config"
9+
"github.com/vektra/mockery/v2/pkg/config"
1010
"gopkg.in/yaml.v2"
1111
)
1212

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/vektra/mockery
1+
module github.com/vektra/mockery/v2
22

33
go 1.14
44

Diff for: go.sum

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s
186186
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
187187
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
188188
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
189+
github.com/vektra/mockery v1.1.2 h1:uc0Yn67rJpjt8U/mAZimdCKn9AeA97BOkjpmtBSlfP4=
189190
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
190191
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
191192
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

Diff for: main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"github.com/vektra/mockery/cmd"
4+
"github.com/vektra/mockery/v2/cmd"
55
)
66

77
func main() {

Diff for: mocks/pkg/OutputStreamProvider.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mocks/pkg/WalkerVisitor.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mocks/pkg/fixtures/A.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mocks/pkg/fixtures/Example.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mocks/pkg/fixtures/HasConflictingNestedImports.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mocks/pkg/fixtures/ImportsSameAsPackage.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mocks/pkg/fixtures/KeyManager.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mocks/pkg/fixtures/MapToInterface.go

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: mocks/pkg/fixtures/UsesOtherPkgIface.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pkg/compat_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55

66
"github.com/stretchr/testify/mock"
77
"github.com/stretchr/testify/suite"
8-
mocks "github.com/vektra/mockery/mocks/pkg/fixtures"
8+
mocks "github.com/vektra/mockery/v2/mocks/pkg/fixtures"
99
)
1010

1111
// CompatSuite covers compatbility with github.com/stretchr/testify/mock.

Diff for: pkg/fixtures/imports_from_nested_interface.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package test
22

33
import (
4-
"github.com/vektra/mockery/pkg/fixtures/http"
4+
"github.com/vektra/mockery/v2/pkg/fixtures/http"
55
)
66

77
type HasConflictingNestedImports interface {

Diff for: pkg/fixtures/imports_same_as_package.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package test
22

33
import (
4-
"github.com/vektra/mockery/pkg/fixtures/test"
4+
"github.com/vektra/mockery/v2/pkg/fixtures/test"
55
)
66

77
type C int

Diff for: pkg/fixtures/same_name_imports.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package test
33
import (
44
"net/http"
55

6-
my_http "github.com/vektra/mockery/pkg/fixtures/http"
6+
my_http "github.com/vektra/mockery/v2/pkg/fixtures/http"
77
)
88

99
// Example is an example

Diff for: pkg/generator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717
"unicode"
1818

1919
"github.com/rs/zerolog"
20-
"github.com/vektra/mockery/pkg/config"
21-
"github.com/vektra/mockery/pkg/logging"
20+
"github.com/vektra/mockery/v2/pkg/config"
21+
"github.com/vektra/mockery/v2/pkg/logging"
2222
"golang.org/x/tools/imports"
2323
)
2424

Diff for: pkg/generator_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
"github.com/stretchr/testify/require"
1313
"github.com/stretchr/testify/suite"
14-
"github.com/vektra/mockery/pkg/config"
14+
"github.com/vektra/mockery/v2/pkg/config"
1515
)
1616

1717
const pkg = "test"
@@ -218,7 +218,7 @@ func (s *GeneratorSuite) TestGeneratorPrologue() {
218218
expected := `package mocks
219219
220220
import mock "github.com/stretchr/testify/mock"
221-
import test "github.com/vektra/mockery/pkg/fixtures"
221+
import test "github.com/vektra/mockery/v2/pkg/fixtures"
222222
223223
`
224224
s.checkPrologueGeneration(generator, expected)
@@ -230,7 +230,7 @@ func (s *GeneratorSuite) TestGeneratorPrologueWithImports() {
230230
231231
import http "net/http"
232232
import mock "github.com/stretchr/testify/mock"
233-
import test "github.com/vektra/mockery/pkg/fixtures"
233+
import test "github.com/vektra/mockery/v2/pkg/fixtures"
234234
235235
`
236236
s.checkPrologueGeneration(generator, expected)
@@ -241,10 +241,10 @@ func (s *GeneratorSuite) TestGeneratorPrologueWithMultipleImportsSameName() {
241241

242242
expected := `package mocks
243243
244-
import fixtureshttp "github.com/vektra/mockery/pkg/fixtures/http"
244+
import fixtureshttp "github.com/vektra/mockery/v2/pkg/fixtures/http"
245245
import http "net/http"
246246
import mock "github.com/stretchr/testify/mock"
247-
import test "github.com/vektra/mockery/pkg/fixtures"
247+
import test "github.com/vektra/mockery/v2/pkg/fixtures"
248248
249249
`
250250
s.checkPrologueGeneration(generator, expected)
@@ -962,7 +962,7 @@ func (s *GeneratorSuite) TestGeneratorWithImportSameAsLocalPackageInpkgNoCycle()
962962
InPackage: true,
963963
}, iface, pkg)
964964
gen.GeneratePrologue(s.ctx, pkg)
965-
s.NotContains(gen.buf.String(), `import test "github.com/vektra/mockery/pkg/fixtures/test"`)
965+
s.NotContains(gen.buf.String(), `import test "github.com/vektra/mockery/v2/pkg/fixtures/test"`)
966966
}
967967

968968
func (s *GeneratorSuite) TestMapToInterface() {
@@ -1044,7 +1044,7 @@ func (s *GeneratorSuite) TestPrologueWithImportSameAsLocalPackage() {
10441044
10451045
import fixtures "` + generator.iface.QualifiedName + `"
10461046
import mock "github.com/stretchr/testify/mock"
1047-
import test "github.com/vektra/mockery/pkg/fixtures/test"
1047+
import test "github.com/vektra/mockery/v2/pkg/fixtures/test"
10481048
10491049
`
10501050
s.checkPrologueGeneration(generator, expected)
@@ -1056,10 +1056,10 @@ func (s *GeneratorSuite) TestPrologueWithImportFromNestedInterface() {
10561056
)
10571057
expected := `package mocks
10581058
1059-
import fixtureshttp "github.com/vektra/mockery/pkg/fixtures/http"
1059+
import fixtureshttp "github.com/vektra/mockery/v2/pkg/fixtures/http"
10601060
import http "net/http"
10611061
import mock "github.com/stretchr/testify/mock"
1062-
import test "github.com/vektra/mockery/pkg/fixtures"
1062+
import test "github.com/vektra/mockery/v2/pkg/fixtures"
10631063
10641064
`
10651065

Diff for: pkg/outputter.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"strings"
1010

1111
"github.com/rs/zerolog"
12-
"github.com/vektra/mockery/pkg/config"
13-
"github.com/vektra/mockery/pkg/logging"
12+
"github.com/vektra/mockery/v2/pkg/config"
13+
"github.com/vektra/mockery/v2/pkg/logging"
1414
)
1515

1616
type Cleanup func() error

Diff for: pkg/parse.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strings"
1212

1313
"github.com/rs/zerolog"
14-
"github.com/vektra/mockery/pkg/logging"
14+
"github.com/vektra/mockery/v2/pkg/logging"
1515
"golang.org/x/tools/go/packages"
1616
)
1717

Diff for: pkg/walker.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"regexp"
1111
"strings"
1212

13-
"github.com/vektra/mockery/pkg/config"
14-
"github.com/vektra/mockery/pkg/logging"
13+
"github.com/vektra/mockery/v2/pkg/config"
14+
"github.com/vektra/mockery/v2/pkg/logging"
1515

1616
"github.com/rs/zerolog"
1717
)

Diff for: pkg/walker_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestWalkerHere(t *testing.T) {
4646
first := gv.Interfaces[0]
4747
assert.Equal(t, "A", first.Name)
4848
assert.Equal(t, getFixturePath("struct_value.go"), first.FileName)
49-
assert.Equal(t, "github.com/vektra/mockery/pkg/fixtures", first.QualifiedName)
49+
assert.Equal(t, "github.com/vektra/mockery/v2/pkg/fixtures", first.QualifiedName)
5050
}
5151

5252
func TestWalkerRegexp(t *testing.T) {
@@ -71,5 +71,5 @@ func TestWalkerRegexp(t *testing.T) {
7171
first := gv.Interfaces[0]
7272
assert.Equal(t, "AsyncProducer", first.Name)
7373
assert.Equal(t, getFixturePath("async.go"), first.FileName)
74-
assert.Equal(t, "github.com/vektra/mockery/pkg/fixtures", first.QualifiedName)
74+
assert.Equal(t, "github.com/vektra/mockery/v2/pkg/fixtures", first.QualifiedName)
7575
}

0 commit comments

Comments
 (0)