gomonkey is a library to make monkey patching in unit tests easy
Go
2,266
143 commits
updated Sep 20, 2026
gomonkey is a library to make monkey patching in unit tests easy, and the core idea of monkey patching comes from Bouke, you can read this blogpost for an explanation on how it works.
-gcflags=-l(below go1.10) or -gcflags=all=-l(go1.10 and above).ARCH
OS
$ go get github.com/agiledragon/gomonkey@v2.0.2
$ go get github.com/agiledragon/gomonkey/v2@v2.11.0
$ go test . ./test -gcflags=all=-l
Please refer to the test cases as idioms, very complete and detailed.
407 followers · starred Jul 2022
185 followers · starred Feb 2022
129 followers · starred Nov 2022
746 followers · starred Apr 2025
gomonkey is a library to make monkey patching in unit tests easy
Go
2,266
143 commits
updated Sep 20, 2026
gomonkey is a library to make monkey patching in unit tests easy, and the core idea of monkey patching comes from Bouke, you can read this blogpost for an explanation on how it works.
-gcflags=-l(below go1.10) or -gcflags=all=-l(go1.10 and above).ARCH
OS
$ go get github.com/agiledragon/gomonkey@v2.0.2
$ go get github.com/agiledragon/gomonkey/v2@v2.11.0
$ go test . ./test -gcflags=all=-l
Please refer to the test cases as idioms, very complete and detailed.
407 followers · starred Jul 2022
185 followers · starred Feb 2022
129 followers · starred Nov 2022
746 followers · starred Apr 2025