We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrivateMethodStruct add two private methods:
func (this *PrivateMethodStruct) lastError() error{ return nil } func (this *PrivateMethodStruct) LastError() error{ return this.lastError() }
TestApplyPrivateMethod add test below:
Convey("patch private method return interface", func() { f := new(fake.PrivateMethodStruct) var s *fake.PrivateMethodStruct pErr := errors.New("error") patches := ApplyPrivateMethod(s, "lastError", func() error { return pErr }) defer patches.Reset() result := f.LastError() So(result, ShouldEqual, pErr) })
we got a panic: invalid memory address or nil pointer dereference
The text was updated successfully, but these errors were encountered:
No branches or pull requests
PrivateMethodStruct add two private methods:
TestApplyPrivateMethod add test below:
we got a panic: invalid memory address or nil pointer dereference
The text was updated successfully, but these errors were encountered: