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
Go Version: go version go1.18.2 darwin/amd64 MacOS version: macOS Monterey, version 12.3.1, Intel gomockey version: v2.9.0
Sample code
package go_play import ( "fmt" "github.com/agiledragon/gomonkey/v2" "testing" ) type Dummy interface { Get(a string) string } type dummy struct { } func (t *dummy) Get(a string) string { return "prefix: " + a } func Test_go(t *testing.T) { patches := gomonkey.NewPatches() defer patches.Reset() patches.ApplyMethod(&dummy{}, "Get", func(_ Dummy, in string) string { fmt.Println("IN: " + in) //Panic return "dummy" }) ret := (&dummy{}).Get("hello") fmt.Printf("Actual: " + ret) }
The text was updated successfully, but these errors were encountered:
Panic with -gcflags=all=-l No Panic with -gcflags=-l, but fmt.Println("IN: " + in) not works as expected, only output IN:
fmt.Println("IN: " + in)
IN:
Sorry, something went wrong.
No branches or pull requests
Go Version: go version go1.18.2 darwin/amd64
MacOS version: macOS Monterey, version 12.3.1, Intel
gomockey version: v2.9.0
Sample code
The text was updated successfully, but these errors were encountered: