From 561c12abf8ecab8c2107fcabc13c3cfd8eeae850 Mon Sep 17 00:00:00 2001 From: LandonTClipp Date: Wed, 17 Mar 2021 21:45:28 -0500 Subject: [PATCH] Fixing issue with semver Fixing issue with "v" being included twice. --- mocks/cmd/stackTracer.go | 2 +- mocks/pkg/Cleanup.go | 24 +++++++++ mocks/pkg/OutputStreamProvider.go | 2 +- mocks/pkg/WalkerVisitor.go | 2 +- mocks/pkg/fixtures/A.go | 2 +- mocks/pkg/fixtures/AsyncProducer.go | 2 +- mocks/pkg/fixtures/Blank.go | 2 +- mocks/pkg/fixtures/ConsulLock.go | 2 +- mocks/pkg/fixtures/Example.go | 2 +- mocks/pkg/fixtures/Fooer.go | 2 +- mocks/pkg/fixtures/FuncArgsCollision.go | 24 +++++++++ .../fixtures/HasConflictingNestedImports.go | 2 +- mocks/pkg/fixtures/ImportsSameAsPackage.go | 2 +- mocks/pkg/fixtures/KeyManager.go | 2 +- mocks/pkg/fixtures/MapFunc.go | 2 +- mocks/pkg/fixtures/MapToInterface.go | 2 +- mocks/pkg/fixtures/MyReader.go | 2 +- mocks/pkg/fixtures/Requester.go | 2 +- mocks/pkg/fixtures/Requester2.go | 2 +- mocks/pkg/fixtures/Requester3.go | 2 +- mocks/pkg/fixtures/Requester4.go | 2 +- .../pkg/fixtures/RequesterArgSameAsImport.go | 2 +- .../fixtures/RequesterArgSameAsNamedImport.go | 2 +- mocks/pkg/fixtures/RequesterArgSameAsPkg.go | 2 +- mocks/pkg/fixtures/RequesterArray.go | 2 +- mocks/pkg/fixtures/RequesterElided.go | 2 +- mocks/pkg/fixtures/RequesterIface.go | 2 +- mocks/pkg/fixtures/RequesterNS.go | 2 +- mocks/pkg/fixtures/RequesterPtr.go | 2 +- mocks/pkg/fixtures/RequesterReturnElided.go | 2 +- mocks/pkg/fixtures/RequesterSlice.go | 2 +- mocks/pkg/fixtures/RequesterVariadic.go | 2 +- mocks/pkg/fixtures/SendFunc.go | 35 +++++++++++++ mocks/pkg/fixtures/Sibling.go | 2 +- mocks/pkg/fixtures/UsesOtherPkgIface.go | 2 +- .../comment/IfaceWithBuildTagInComment.go | 2 +- .../filename/IfaceWithBuildTagInFilename.go | 2 +- mocks/pkg/fixtures/example_project/Root.go | 41 +++++++++++++++ mocks/pkg/fixtures/example_project/foo/Foo.go | 50 +++++++++++++++++++ mocks/pkg/fixtures/requester_unexported.go | 2 +- mocks/pkg/namer.go | 2 +- pkg/config/config.go | 8 +-- pkg/generator.go | 2 +- 43 files changed, 215 insertions(+), 41 deletions(-) create mode 100644 mocks/pkg/Cleanup.go create mode 100644 mocks/pkg/fixtures/FuncArgsCollision.go create mode 100644 mocks/pkg/fixtures/SendFunc.go create mode 100644 mocks/pkg/fixtures/example_project/Root.go create mode 100644 mocks/pkg/fixtures/example_project/foo/Foo.go diff --git a/mocks/cmd/stackTracer.go b/mocks/cmd/stackTracer.go index 52f8ae35..1baf9ee0 100644 --- a/mocks/cmd/stackTracer.go +++ b/mocks/cmd/stackTracer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/Cleanup.go b/mocks/pkg/Cleanup.go new file mode 100644 index 00000000..5b21fb56 --- /dev/null +++ b/mocks/pkg/Cleanup.go @@ -0,0 +1,24 @@ +// Code generated by mockery (devel). DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// Cleanup is an autogenerated mock type for the Cleanup type +type Cleanup struct { + mock.Mock +} + +// Execute provides a mock function with given fields: +func (_m *Cleanup) Execute() error { + ret := _m.Called() + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} diff --git a/mocks/pkg/OutputStreamProvider.go b/mocks/pkg/OutputStreamProvider.go index f804da30..220f3f55 100644 --- a/mocks/pkg/OutputStreamProvider.go +++ b/mocks/pkg/OutputStreamProvider.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/WalkerVisitor.go b/mocks/pkg/WalkerVisitor.go index 75fe4c2f..ea80b46c 100644 --- a/mocks/pkg/WalkerVisitor.go +++ b/mocks/pkg/WalkerVisitor.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/A.go b/mocks/pkg/fixtures/A.go index 9b3b8c6a..6b571dfb 100644 --- a/mocks/pkg/fixtures/A.go +++ b/mocks/pkg/fixtures/A.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/AsyncProducer.go b/mocks/pkg/fixtures/AsyncProducer.go index f5198c6f..a3285d47 100644 --- a/mocks/pkg/fixtures/AsyncProducer.go +++ b/mocks/pkg/fixtures/AsyncProducer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/Blank.go b/mocks/pkg/fixtures/Blank.go index b6d64c41..d0af5af2 100644 --- a/mocks/pkg/fixtures/Blank.go +++ b/mocks/pkg/fixtures/Blank.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/ConsulLock.go b/mocks/pkg/fixtures/ConsulLock.go index 9ffa2dd1..6ec45c17 100644 --- a/mocks/pkg/fixtures/ConsulLock.go +++ b/mocks/pkg/fixtures/ConsulLock.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/Example.go b/mocks/pkg/fixtures/Example.go index dacd6e62..91596dc7 100644 --- a/mocks/pkg/fixtures/Example.go +++ b/mocks/pkg/fixtures/Example.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/Fooer.go b/mocks/pkg/fixtures/Fooer.go index 9d6af112..54737c1a 100644 --- a/mocks/pkg/fixtures/Fooer.go +++ b/mocks/pkg/fixtures/Fooer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/FuncArgsCollision.go b/mocks/pkg/fixtures/FuncArgsCollision.go new file mode 100644 index 00000000..b5082ec4 --- /dev/null +++ b/mocks/pkg/fixtures/FuncArgsCollision.go @@ -0,0 +1,24 @@ +// Code generated by mockery (devel). DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// FuncArgsCollision is an autogenerated mock type for the FuncArgsCollision type +type FuncArgsCollision struct { + mock.Mock +} + +// Foo provides a mock function with given fields: ret +func (_m *FuncArgsCollision) Foo(ret interface{}) error { + ret_1 := _m.Called(ret) + + var r0 error + if rf, ok := ret_1.Get(0).(func(interface{}) error); ok { + r0 = rf(ret) + } else { + r0 = ret_1.Error(0) + } + + return r0 +} diff --git a/mocks/pkg/fixtures/HasConflictingNestedImports.go b/mocks/pkg/fixtures/HasConflictingNestedImports.go index 7ae91ec3..f3621016 100644 --- a/mocks/pkg/fixtures/HasConflictingNestedImports.go +++ b/mocks/pkg/fixtures/HasConflictingNestedImports.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/ImportsSameAsPackage.go b/mocks/pkg/fixtures/ImportsSameAsPackage.go index f00f54c7..e71ffcba 100644 --- a/mocks/pkg/fixtures/ImportsSameAsPackage.go +++ b/mocks/pkg/fixtures/ImportsSameAsPackage.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/KeyManager.go b/mocks/pkg/fixtures/KeyManager.go index c46835b3..58acf101 100644 --- a/mocks/pkg/fixtures/KeyManager.go +++ b/mocks/pkg/fixtures/KeyManager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/MapFunc.go b/mocks/pkg/fixtures/MapFunc.go index 535a3c86..3c220733 100644 --- a/mocks/pkg/fixtures/MapFunc.go +++ b/mocks/pkg/fixtures/MapFunc.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/MapToInterface.go b/mocks/pkg/fixtures/MapToInterface.go index 48b8d2b8..8dc6ea28 100644 --- a/mocks/pkg/fixtures/MapToInterface.go +++ b/mocks/pkg/fixtures/MapToInterface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/MyReader.go b/mocks/pkg/fixtures/MyReader.go index ec428ea5..ac6df635 100644 --- a/mocks/pkg/fixtures/MyReader.go +++ b/mocks/pkg/fixtures/MyReader.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/Requester.go b/mocks/pkg/fixtures/Requester.go index 7935a4e7..f2443190 100644 --- a/mocks/pkg/fixtures/Requester.go +++ b/mocks/pkg/fixtures/Requester.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/Requester2.go b/mocks/pkg/fixtures/Requester2.go index 846fdb3e..27b75c7b 100644 --- a/mocks/pkg/fixtures/Requester2.go +++ b/mocks/pkg/fixtures/Requester2.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/Requester3.go b/mocks/pkg/fixtures/Requester3.go index 3cb70224..67187509 100644 --- a/mocks/pkg/fixtures/Requester3.go +++ b/mocks/pkg/fixtures/Requester3.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/Requester4.go b/mocks/pkg/fixtures/Requester4.go index b3c8f664..809db5f1 100644 --- a/mocks/pkg/fixtures/Requester4.go +++ b/mocks/pkg/fixtures/Requester4.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterArgSameAsImport.go b/mocks/pkg/fixtures/RequesterArgSameAsImport.go index ea81edcd..638adfb0 100644 --- a/mocks/pkg/fixtures/RequesterArgSameAsImport.go +++ b/mocks/pkg/fixtures/RequesterArgSameAsImport.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterArgSameAsNamedImport.go b/mocks/pkg/fixtures/RequesterArgSameAsNamedImport.go index 854043a8..a4d5d5b1 100644 --- a/mocks/pkg/fixtures/RequesterArgSameAsNamedImport.go +++ b/mocks/pkg/fixtures/RequesterArgSameAsNamedImport.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterArgSameAsPkg.go b/mocks/pkg/fixtures/RequesterArgSameAsPkg.go index 0911d6e3..5c8f053d 100644 --- a/mocks/pkg/fixtures/RequesterArgSameAsPkg.go +++ b/mocks/pkg/fixtures/RequesterArgSameAsPkg.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterArray.go b/mocks/pkg/fixtures/RequesterArray.go index 8a66edd4..98a26926 100644 --- a/mocks/pkg/fixtures/RequesterArray.go +++ b/mocks/pkg/fixtures/RequesterArray.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterElided.go b/mocks/pkg/fixtures/RequesterElided.go index 0bae0b59..9d131449 100644 --- a/mocks/pkg/fixtures/RequesterElided.go +++ b/mocks/pkg/fixtures/RequesterElided.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterIface.go b/mocks/pkg/fixtures/RequesterIface.go index 39cdc546..b12c0fc9 100644 --- a/mocks/pkg/fixtures/RequesterIface.go +++ b/mocks/pkg/fixtures/RequesterIface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterNS.go b/mocks/pkg/fixtures/RequesterNS.go index 753bb196..3a6ba850 100644 --- a/mocks/pkg/fixtures/RequesterNS.go +++ b/mocks/pkg/fixtures/RequesterNS.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterPtr.go b/mocks/pkg/fixtures/RequesterPtr.go index 881ed744..d819929a 100644 --- a/mocks/pkg/fixtures/RequesterPtr.go +++ b/mocks/pkg/fixtures/RequesterPtr.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterReturnElided.go b/mocks/pkg/fixtures/RequesterReturnElided.go index 4c5b5901..362c119b 100644 --- a/mocks/pkg/fixtures/RequesterReturnElided.go +++ b/mocks/pkg/fixtures/RequesterReturnElided.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterSlice.go b/mocks/pkg/fixtures/RequesterSlice.go index 636a1754..dbc9bd08 100644 --- a/mocks/pkg/fixtures/RequesterSlice.go +++ b/mocks/pkg/fixtures/RequesterSlice.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/RequesterVariadic.go b/mocks/pkg/fixtures/RequesterVariadic.go index 5f341658..8c43aabe 100644 --- a/mocks/pkg/fixtures/RequesterVariadic.go +++ b/mocks/pkg/fixtures/RequesterVariadic.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/SendFunc.go b/mocks/pkg/fixtures/SendFunc.go new file mode 100644 index 00000000..475d22df --- /dev/null +++ b/mocks/pkg/fixtures/SendFunc.go @@ -0,0 +1,35 @@ +// Code generated by mockery (devel). DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" +) + +// SendFunc is an autogenerated mock type for the SendFunc type +type SendFunc struct { + mock.Mock +} + +// Execute provides a mock function with given fields: ctx, data +func (_m *SendFunc) Execute(ctx context.Context, data string) (int, error) { + ret := _m.Called(ctx, data) + + var r0 int + if rf, ok := ret.Get(0).(func(context.Context, string) int); ok { + r0 = rf(ctx, data) + } else { + r0 = ret.Get(0).(int) + } + + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, data) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/mocks/pkg/fixtures/Sibling.go b/mocks/pkg/fixtures/Sibling.go index c138928e..28ec245d 100644 --- a/mocks/pkg/fixtures/Sibling.go +++ b/mocks/pkg/fixtures/Sibling.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/UsesOtherPkgIface.go b/mocks/pkg/fixtures/UsesOtherPkgIface.go index dab05b06..759fd8f3 100644 --- a/mocks/pkg/fixtures/UsesOtherPkgIface.go +++ b/mocks/pkg/fixtures/UsesOtherPkgIface.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/buildtag/comment/IfaceWithBuildTagInComment.go b/mocks/pkg/fixtures/buildtag/comment/IfaceWithBuildTagInComment.go index 00454c79..87c6b824 100644 --- a/mocks/pkg/fixtures/buildtag/comment/IfaceWithBuildTagInComment.go +++ b/mocks/pkg/fixtures/buildtag/comment/IfaceWithBuildTagInComment.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/buildtag/filename/IfaceWithBuildTagInFilename.go b/mocks/pkg/fixtures/buildtag/filename/IfaceWithBuildTagInFilename.go index 9be0f2bb..b6a565ca 100644 --- a/mocks/pkg/fixtures/buildtag/filename/IfaceWithBuildTagInFilename.go +++ b/mocks/pkg/fixtures/buildtag/filename/IfaceWithBuildTagInFilename.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/fixtures/example_project/Root.go b/mocks/pkg/fixtures/example_project/Root.go new file mode 100644 index 00000000..ff9f7881 --- /dev/null +++ b/mocks/pkg/fixtures/example_project/Root.go @@ -0,0 +1,41 @@ +// Code generated by mockery (devel). DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + foo "github.com/vektra/mockery/v2/pkg/fixtures/example_project/foo" +) + +// Root is an autogenerated mock type for the Root type +type Root struct { + mock.Mock +} + +// ReturnsFoo provides a mock function with given fields: +func (_m *Root) ReturnsFoo() (foo.Foo, error) { + ret := _m.Called() + + var r0 foo.Foo + if rf, ok := ret.Get(0).(func() foo.Foo); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(foo.Foo) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// TakesBaz provides a mock function with given fields: _a0 +func (_m *Root) TakesBaz(_a0 *foo.Baz) { + _m.Called(_a0) +} diff --git a/mocks/pkg/fixtures/example_project/foo/Foo.go b/mocks/pkg/fixtures/example_project/foo/Foo.go new file mode 100644 index 00000000..8c16a233 --- /dev/null +++ b/mocks/pkg/fixtures/example_project/foo/Foo.go @@ -0,0 +1,50 @@ +// Code generated by mockery (devel). DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + foo "github.com/vektra/mockery/v2/pkg/fixtures/example_project/foo" +) + +// Foo is an autogenerated mock type for the Foo type +type Foo struct { + mock.Mock +} + +// DoFoo provides a mock function with given fields: +func (_m *Foo) DoFoo() string { + ret := _m.Called() + + var r0 string + if rf, ok := ret.Get(0).(func() string); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(string) + } + + return r0 +} + +// GetBaz provides a mock function with given fields: +func (_m *Foo) GetBaz() (*foo.Baz, error) { + ret := _m.Called() + + var r0 *foo.Baz + if rf, ok := ret.Get(0).(func() *foo.Baz); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*foo.Baz) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} diff --git a/mocks/pkg/fixtures/requester_unexported.go b/mocks/pkg/fixtures/requester_unexported.go index dabf52cc..7c83b74f 100644 --- a/mocks/pkg/fixtures/requester_unexported.go +++ b/mocks/pkg/fixtures/requester_unexported.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/mocks/pkg/namer.go b/mocks/pkg/namer.go index 5a7ca9d4..986233bf 100644 --- a/mocks/pkg/namer.go +++ b/mocks/pkg/namer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery (devel). DO NOT EDIT. package mocks diff --git a/pkg/config/config.go b/pkg/config/config.go index cdedb8fa..b69169fa 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -3,16 +3,16 @@ package config import "runtime/debug" // SemVer is the version of mockery at build time. -var SemVer = "0.0.0-dev" +var SemVer = "v0.0.0-dev" // GetSemverInfo attempts to read and return the go build info of Mockery // If a version is not found, the fallback versioning is returned func GetSemverInfo() string { info, ok := debug.ReadBuildInfo() if !ok { - return SemVer - } - return info.Main.Version + return SemVer + } + return info.Main.Version } type Config struct { diff --git a/pkg/generator.go b/pkg/generator.go index c5a1fbb1..d1e4cfd7 100644 --- a/pkg/generator.go +++ b/pkg/generator.go @@ -262,7 +262,7 @@ func (g *Generator) GeneratePrologue(ctx context.Context, pkg string) { func (g *Generator) GeneratePrologueNote(note string) { prologue := "// Code generated by mockery" if !g.Config.DisableVersionString { - prologue += fmt.Sprintf(" v%s", config.GetSemverInfo()) + prologue += fmt.Sprintf(" %s", config.GetSemverInfo()) } prologue += ". DO NOT EDIT.\n"