diff --git a/mocks/github.com/vektra/mockery/v2/pkg/TypesPackage.go b/mocks/github.com/vektra/mockery/v2/pkg/TypesPackage.go index 4acb2052..dc30f202 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/TypesPackage.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/TypesPackage.go @@ -22,7 +22,7 @@ func (_m *TypesPackage) Name() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Name()") + panic("no return value specified for Name") } var r0 string @@ -67,7 +67,7 @@ func (_m *TypesPackage) Path() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Path()") + panic("no return value specified for Path") } var r0 string diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/A.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/A.go index 90e69f03..afbdf941 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/A.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/A.go @@ -25,7 +25,7 @@ func (_m *A) Call() (test.B, error) { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Call()") + panic("no return value specified for Call") } var r0 test.B diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/AsyncProducer.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/AsyncProducer.go index a2750ff8..bef64eca 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/AsyncProducer.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/AsyncProducer.go @@ -22,7 +22,7 @@ func (_m *AsyncProducer) Input() chan<- bool { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Input()") + panic("no return value specified for Input") } var r0 chan<- bool @@ -69,7 +69,7 @@ func (_m *AsyncProducer) Output() <-chan bool { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Output()") + panic("no return value specified for Output") } var r0 <-chan bool @@ -116,7 +116,7 @@ func (_m *AsyncProducer) Whatever() chan bool { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Whatever()") + panic("no return value specified for Whatever") } var r0 chan bool diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Blank.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Blank.go index 517b0c4f..f48ecb9c 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Blank.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Blank.go @@ -22,7 +22,7 @@ func (_m *Blank) Create(x interface{}) error { ret := _m.Called(x) if len(ret) == 0 { - panic("Missing Return() function for Create()") + panic("no return value specified for Create") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ConsulLock.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ConsulLock.go index 0cff9230..2dfe5dc6 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ConsulLock.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ConsulLock.go @@ -22,7 +22,7 @@ func (_m *ConsulLock) Lock(_a0 <-chan struct{}) (<-chan struct{}, error) { ret := _m.Called(_a0) if len(ret) == 0 { - panic("Missing Return() function for Lock()") + panic("no return value specified for Lock") } var r0 <-chan struct{} @@ -80,7 +80,7 @@ func (_m *ConsulLock) Unlock() error { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Unlock()") + panic("no return value specified for Unlock") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmbeddedGet.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmbeddedGet.go index acd10c98..a87f878a 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmbeddedGet.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/EmbeddedGet.go @@ -25,7 +25,7 @@ func (_m *EmbeddedGet[T]) Get() T { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 T diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Example.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Example.go index deac5988..382004a6 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Example.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Example.go @@ -28,7 +28,7 @@ func (_m *Example) A() http.Flusher { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for A()") + panic("no return value specified for A") } var r0 http.Flusher @@ -75,7 +75,7 @@ func (_m *Example) B(_a0 string) fixtureshttp.MyStruct { ret := _m.Called(_a0) if len(ret) == 0 { - panic("Missing Return() function for B()") + panic("no return value specified for B") } var r0 fixtureshttp.MyStruct diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Expecter.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Expecter.go index f39cb16e..2807c78d 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Expecter.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Expecter.go @@ -22,7 +22,7 @@ func (_m *Expecter) ManyArgsReturns(str string, i int) ([]string, error) { ret := _m.Called(str, i) if len(ret) == 0 { - panic("Missing Return() function for ManyArgsReturns()") + panic("no return value specified for ManyArgsReturns") } var r0 []string @@ -81,7 +81,7 @@ func (_m *Expecter) NoArg() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for NoArg()") + panic("no return value specified for NoArg") } var r0 string @@ -165,7 +165,7 @@ func (_m *Expecter) Variadic(ints ...int) error { ret := _m.Called(_ca...) if len(ret) == 0 { - panic("Missing Return() function for Variadic()") + panic("no return value specified for Variadic") } var r0 error @@ -221,7 +221,7 @@ func (_m *Expecter) VariadicMany(i int, a string, intfs ...interface{}) error { ret := _m.Called(_ca...) if len(ret) == 0 { - panic("Missing Return() function for VariadicMany()") + panic("no return value specified for VariadicMany") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ExpecterAndRolledVariadic.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ExpecterAndRolledVariadic.go index 9e32afb9..6fd6ffa0 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ExpecterAndRolledVariadic.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ExpecterAndRolledVariadic.go @@ -22,7 +22,7 @@ func (_m *ExpecterAndRolledVariadic) ManyArgsReturns(str string, i int) ([]strin ret := _m.Called(str, i) if len(ret) == 0 { - panic("Missing Return() function for ManyArgsReturns()") + panic("no return value specified for ManyArgsReturns") } var r0 []string @@ -81,7 +81,7 @@ func (_m *ExpecterAndRolledVariadic) NoArg() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for NoArg()") + panic("no return value specified for NoArg") } var r0 string @@ -165,7 +165,7 @@ func (_m *ExpecterAndRolledVariadic) Variadic(ints ...int) error { ret := tmpRet if len(ret) == 0 { - panic("Missing Return() function for Variadic()") + panic("no return value specified for Variadic") } var r0 error @@ -224,7 +224,7 @@ func (_m *ExpecterAndRolledVariadic) VariadicMany(i int, a string, intfs ...inte ret := tmpRet if len(ret) == 0 { - panic("Missing Return() function for VariadicMany()") + panic("no return value specified for VariadicMany") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Fooer.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Fooer.go index 17877aad..c172417b 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Fooer.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Fooer.go @@ -55,7 +55,7 @@ func (_m *Fooer) Baz(path string) func(string) string { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Baz()") + panic("no return value specified for Baz") } var r0 func(string) string @@ -103,7 +103,7 @@ func (_m *Fooer) Foo(f func(string) string) error { ret := _m.Called(f) if len(ret) == 0 { - panic("Missing Return() function for Foo()") + panic("no return value specified for Foo") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/FuncArgsCollision.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/FuncArgsCollision.go index 83b5864b..493844c8 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/FuncArgsCollision.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/FuncArgsCollision.go @@ -22,7 +22,7 @@ func (_m *FuncArgsCollision) Foo(ret interface{}) error { ret_1 := _m.Called(ret) if len(ret_1) == 0 { - panic("Missing Return() function for Foo()") + panic("no return value specified for Foo") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetGeneric.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetGeneric.go index 4bec1a73..fadb46f7 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetGeneric.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetGeneric.go @@ -25,7 +25,7 @@ func (_m *GetGeneric[T]) Get() T { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 T diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetInt.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetInt.go index 7656765a..0eeb3b4f 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetInt.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/GetInt.go @@ -22,7 +22,7 @@ func (_m *GetInt) Get() int { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 int diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/HasConflictingNestedImports.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/HasConflictingNestedImports.go index e9f11365..7249de4f 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/HasConflictingNestedImports.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/HasConflictingNestedImports.go @@ -28,7 +28,7 @@ func (_m *HasConflictingNestedImports) Get(path string) (http.Response, error) { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 http.Response @@ -84,7 +84,7 @@ func (_m *HasConflictingNestedImports) Z() fixtureshttp.MyStruct { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Z()") + panic("no return value specified for Z") } var r0 fixtureshttp.MyStruct diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ImportsSameAsPackage.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ImportsSameAsPackage.go index 584582c8..e8045f24 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ImportsSameAsPackage.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/ImportsSameAsPackage.go @@ -27,7 +27,7 @@ func (_m *ImportsSameAsPackage) A() test.B { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for A()") + panic("no return value specified for A") } var r0 test.B @@ -72,7 +72,7 @@ func (_m *ImportsSameAsPackage) B() fixtures.KeyManager { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for B()") + panic("no return value specified for B") } var r0 fixtures.KeyManager diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/KeyManager.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/KeyManager.go index 450e2cb4..e645861c 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/KeyManager.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/KeyManager.go @@ -25,7 +25,7 @@ func (_m *KeyManager) GetKey(_a0 string, _a1 uint16) ([]byte, *test.Err) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { - panic("Missing Return() function for GetKey()") + panic("no return value specified for GetKey") } var r0 []byte diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapFunc.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapFunc.go index ed8a6d82..6ca90bd6 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapFunc.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MapFunc.go @@ -22,7 +22,7 @@ func (_m *MapFunc) Get(m map[string]func(string) string) error { ret := _m.Called(m) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MyReader.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MyReader.go index 1636433b..c2bf9c29 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MyReader.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/MyReader.go @@ -22,7 +22,7 @@ func (_m *MyReader) Read(p []byte) (int, error) { ret := _m.Called(p) if len(ret) == 0 { - panic("Missing Return() function for Read()") + panic("no return value specified for Read") } var r0 int diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue.go index 06d86f96..eaa5ea6e 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/PanicOnNoReturnValue.go @@ -22,7 +22,7 @@ func (_m *PanicOnNoReturnValue) DoSomething() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for DoSomething()") + panic("no return value specified for DoSomething") } var r0 string diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester.go index 7c585f68..ad20a1c2 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester.go @@ -22,7 +22,7 @@ func (_m *Requester) Get(path string) (string, error) { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 string diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester2.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester2.go index f31860b4..d057dd32 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester2.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester2.go @@ -22,7 +22,7 @@ func (_m *Requester2) Get(path string) error { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester3.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester3.go index 68e3ce6c..2c18c927 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester3.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/Requester3.go @@ -22,7 +22,7 @@ func (_m *Requester3) Get() error { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsImport.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsImport.go index 032f9c9d..153d49c2 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsImport.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsImport.go @@ -26,7 +26,7 @@ func (_m *RequesterArgSameAsImport) Get(_a0 string) *json.RawMessage { ret := _m.Called(_a0) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 *json.RawMessage diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsNamedImport.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsNamedImport.go index 314a2415..fd783552 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsNamedImport.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArgSameAsNamedImport.go @@ -26,7 +26,7 @@ func (_m *RequesterArgSameAsNamedImport) Get(_a0 string) *json.RawMessage { ret := _m.Called(_a0) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 *json.RawMessage diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArray.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArray.go index cff9952f..00e8f1de 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArray.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterArray.go @@ -22,7 +22,7 @@ func (_m *RequesterArray) Get(path string) ([2]string, error) { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 [2]string diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterElided.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterElided.go index 961c4e9b..bfc921a1 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterElided.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterElided.go @@ -22,7 +22,7 @@ func (_m *RequesterElided) Get(path string, url string) error { ret := _m.Called(path, url) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 error diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterGenerics.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterGenerics.go index 2cbd4925..c813b557 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterGenerics.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterGenerics.go @@ -38,7 +38,7 @@ func (_m *RequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TG ret := _m.Called(_a0) if len(ret) == 0 { - panic("Missing Return() function for GenericAnonymousStructs()") + panic("no return value specified for GenericAnonymousStructs") } var r0 struct { @@ -97,7 +97,7 @@ func (_m *RequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TG ret := _m.Called(_a0, _a1) if len(ret) == 0 { - panic("Missing Return() function for GenericArguments()") + panic("no return value specified for GenericArguments") } var r0 TSigned @@ -157,7 +157,7 @@ func (_m *RequesterGenerics[TAny, TComparable, TSigned, TIntf, TExternalIntf, TG ret := _m.Called(_a0) if len(ret) == 0 { - panic("Missing Return() function for GenericStructs()") + panic("no return value specified for GenericStructs") } var r0 test.GenericType[TSigned, TIntf] diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIface.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIface.go index 97c7edc2..78c73113 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIface.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterIface.go @@ -26,7 +26,7 @@ func (_m *RequesterIface) Get() io.Reader { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 io.Reader diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterNS.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterNS.go index 14b80948..3b05d94a 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterNS.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterNS.go @@ -26,7 +26,7 @@ func (_m *RequesterNS) Get(path string) (http.Response, error) { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 http.Response diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterPtr.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterPtr.go index 208b89d1..d3c60f75 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterPtr.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterPtr.go @@ -22,7 +22,7 @@ func (_m *RequesterPtr) Get(path string) (*string, error) { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 *string diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterReturnElided.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterReturnElided.go index c311e288..7d7c7b30 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterReturnElided.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterReturnElided.go @@ -22,7 +22,7 @@ func (_m *RequesterReturnElided) Get(path string) (int, int, int, error) { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 int @@ -92,7 +92,7 @@ func (_m *RequesterReturnElided) Put(path string) (int, error) { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Put()") + panic("no return value specified for Put") } var r0 int diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterSlice.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterSlice.go index 86a0436d..afaa1169 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterSlice.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterSlice.go @@ -22,7 +22,7 @@ func (_m *RequesterSlice) Get(path string) ([]string, error) { ret := _m.Called(path) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 []string diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadic.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadic.go index 13ae0385..dd863d66 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadic.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadic.go @@ -24,7 +24,7 @@ func (_m *RequesterVariadic) Get(values ...string) bool { ret := _m.Called(_ca...) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 bool @@ -49,7 +49,7 @@ func (_m *RequesterVariadic) MultiWriteToFile(filename string, w ...io.Writer) s ret := _m.Called(_ca...) if len(ret) == 0 { - panic("Missing Return() function for MultiWriteToFile()") + panic("no return value specified for MultiWriteToFile") } var r0 string @@ -69,7 +69,7 @@ func (_m *RequesterVariadic) OneInterface(a ...interface{}) bool { ret := _m.Called(_ca...) if len(ret) == 0 { - panic("Missing Return() function for OneInterface()") + panic("no return value specified for OneInterface") } var r0 bool @@ -90,7 +90,7 @@ func (_m *RequesterVariadic) Sprintf(format string, a ...interface{}) string { ret := _m.Called(_ca...) if len(ret) == 0 { - panic("Missing Return() function for Sprintf()") + panic("no return value specified for Sprintf") } var r0 string diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadicOneArgument.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadicOneArgument.go index d6bbd4a0..da4db6ee 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadicOneArgument.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/RequesterVariadicOneArgument.go @@ -18,7 +18,7 @@ func (_m *RequesterVariadicOneArgument) Get(values ...string) bool { ret := _m.Called(values) if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 bool @@ -36,7 +36,7 @@ func (_m *RequesterVariadicOneArgument) MultiWriteToFile(filename string, w ...i ret := _m.Called(filename, w) if len(ret) == 0 { - panic("Missing Return() function for MultiWriteToFile()") + panic("no return value specified for MultiWriteToFile") } var r0 string @@ -54,7 +54,7 @@ func (_m *RequesterVariadicOneArgument) OneInterface(a ...interface{}) bool { ret := _m.Called(a) if len(ret) == 0 { - panic("Missing Return() function for OneInterface()") + panic("no return value specified for OneInterface") } var r0 bool @@ -72,7 +72,7 @@ func (_m *RequesterVariadicOneArgument) Sprintf(format string, a ...interface{}) ret := _m.Called(format, a) if len(ret) == 0 { - panic("Missing Return() function for Sprintf()") + panic("no return value specified for Sprintf") } var r0 string diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/SendFunc.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/SendFunc.go index 283f7c9f..740fe462 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/SendFunc.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/SendFunc.go @@ -26,7 +26,7 @@ func (_m *SendFunc) Execute(ctx context.Context, data string) (int, error) { ret := _m.Called(ctx, data) if len(ret) == 0 { - panic("Missing Return() function for Execute()") + panic("no return value specified for Execute") } var r0 int diff --git a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/StructWithTag.go b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/StructWithTag.go index db572ea1..2686a2c4 100644 --- a/mocks/github.com/vektra/mockery/v2/pkg/fixtures/StructWithTag.go +++ b/mocks/github.com/vektra/mockery/v2/pkg/fixtures/StructWithTag.go @@ -28,7 +28,7 @@ func (_m *StructWithTag) MethodA(v *struct { ret := _m.Called(v) if len(ret) == 0 { - panic("Missing Return() function for MethodA()") + panic("no return value specified for MethodA") } var r0 *struct { diff --git a/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceA_test.go b/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceA_test.go index f0daa351..0a383805 100644 --- a/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceA_test.go +++ b/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceA_test.go @@ -22,7 +22,7 @@ func (_m *interfaceAMock) DoB(interfaceB0 interfaceB) interfaceB { ret := _m.Called(interfaceB0) if len(ret) == 0 { - panic("Missing Return() function for DoB()") + panic("no return value specified for DoB") } var r0 interfaceB @@ -70,7 +70,7 @@ func (_m *interfaceAMock) DoB0(interfaceB interfaceB0) interfaceB0 { ret := _m.Called(interfaceB) if len(ret) == 0 { - panic("Missing Return() function for DoB0()") + panic("no return value specified for DoB0") } var r0 interfaceB0 @@ -118,7 +118,7 @@ func (_m *interfaceAMock) DoB0v2(interfaceB00 interfaceB0) interfaceB0 { ret := _m.Called(interfaceB00) if len(ret) == 0 { - panic("Missing Return() function for DoB0v2()") + panic("no return value specified for DoB0v2") } var r0 interfaceB0 diff --git a/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB0_test.go b/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB0_test.go index 22718121..d5ac136c 100644 --- a/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB0_test.go +++ b/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB0_test.go @@ -22,7 +22,7 @@ func (_m *interfaceB0Mock) DoB0(interfaceB00 interfaceB0) interfaceB0 { ret := _m.Called(interfaceB00) if len(ret) == 0 { - panic("Missing Return() function for DoB0()") + panic("no return value specified for DoB0") } var r0 interfaceB0 diff --git a/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB_test.go b/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB_test.go index 7bfad951..f0538bd7 100644 --- a/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB_test.go +++ b/pkg/fixtures/method_args/same_name_arg_and_type/mock_interfaceB_test.go @@ -22,7 +22,7 @@ func (_m *interfaceBMock) GetData() int { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for GetData()") + panic("no return value specified for GetData") } var r0 int diff --git a/pkg/fixtures/recursive_generation/Foo_mock.go b/pkg/fixtures/recursive_generation/Foo_mock.go index d24cd151..1374b9fa 100644 --- a/pkg/fixtures/recursive_generation/Foo_mock.go +++ b/pkg/fixtures/recursive_generation/Foo_mock.go @@ -22,7 +22,7 @@ func (_m *MockFoo) Get() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 string diff --git a/pkg/fixtures/recursive_generation/subpkg1/Foo_mock.go b/pkg/fixtures/recursive_generation/subpkg1/Foo_mock.go index 99df0b9f..50697c1d 100644 --- a/pkg/fixtures/recursive_generation/subpkg1/Foo_mock.go +++ b/pkg/fixtures/recursive_generation/subpkg1/Foo_mock.go @@ -22,7 +22,7 @@ func (_m *MockFoo) Get() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 string diff --git a/pkg/fixtures/recursive_generation/subpkg2/Foo_mock.go b/pkg/fixtures/recursive_generation/subpkg2/Foo_mock.go index 898ddbf6..fe92d118 100644 --- a/pkg/fixtures/recursive_generation/subpkg2/Foo_mock.go +++ b/pkg/fixtures/recursive_generation/subpkg2/Foo_mock.go @@ -22,7 +22,7 @@ func (_m *MockFoo) Get() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 string diff --git a/pkg/fixtures/recursive_generation/subpkg_with_only_autogenerated_files/Foo_mock.go b/pkg/fixtures/recursive_generation/subpkg_with_only_autogenerated_files/Foo_mock.go index 3e4a2879..9648bcfd 100644 --- a/pkg/fixtures/recursive_generation/subpkg_with_only_autogenerated_files/Foo_mock.go +++ b/pkg/fixtures/recursive_generation/subpkg_with_only_autogenerated_files/Foo_mock.go @@ -22,7 +22,7 @@ func (_m *MockFoo) Get() string { ret := _m.Called() if len(ret) == 0 { - panic("Missing Return() function for Get()") + panic("no return value specified for Get") } var r0 string diff --git a/pkg/fixtures/test/panic_on_no_return_value_test.go b/pkg/fixtures/test/panic_on_no_return_value_test.go index bbc4638d..3257d0ac 100644 --- a/pkg/fixtures/test/panic_on_no_return_value_test.go +++ b/pkg/fixtures/test/panic_on_no_return_value_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" mocks "github.com/vektra/mockery/v2/mocks/github.com/vektra/mockery/v2/pkg/fixtures" ) @@ -11,10 +12,15 @@ func TestPanicOnNoReturnValue(t *testing.T) { m := mocks.NewPanicOnNoReturnValue(t) m.EXPECT().DoSomething() + var panicOccurred bool defer func() { + assert.True(t, panicOccurred) + }() + defer func() { + panicOccurred = true if r := recover(); r != nil { - assert.NotNil(t, r) - assert.Equal(t, "Missing Return() function for DoSomething()", r.(string)) + require.NotNil(t, r) + assert.Equal(t, "no return value specified for DoSomething", r.(string)) } }() diff --git a/pkg/generator.go b/pkg/generator.go index b13e78ed..5cfacc73 100644 --- a/pkg/generator.go +++ b/pkg/generator.go @@ -753,7 +753,7 @@ func (_m *{{.MockName}}{{.InstantiatedTypeString}}) {{.FunctionName}}({{join .Pa {{- .RetVariableName}} := {{.Called}} if len({{.RetVariableName}}) == 0 { - panic("Missing Return() function for {{.FunctionName}}()") + panic("no return value specified for {{.FunctionName}}") } {{range $idx, $name := .Returns.ReturnNames}}