agiledragon / gomonkey

gomonkey is a library to make monkey patching in unit tests easy
MIT License
2.02k stars 179 forks source link
function function-variable global-variable gomonkey interface member-method patch private-method sequence

gomonkey

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.

Features

Notes

Supported Platform:

Installation

Test Method

$ cd test 
$ go test -gcflags=all=-l

Using gomonkey

Please refer to the test cases as idioms, very complete and detailed.