Hacker GitHub

← All repos

bouk/monkey

View on GitHub ↗ ★ 3,418 Go archived

Monkey patching in Go

6 mentions on Hacker News by 6 people: 0 stories, 6 comments · first 2020-02-28 · latest 2026-02-10

Mentions per year 6 mentions · busiest year 2021 (3)
20082026
  1. …implementation, they will all use the standard library. Others have linked to the much more "fun" https://github.com/bouk/monkey which is an actual monkey patch, in that it changes the code that is called from anywhere in the runtime
    comment by awesome_dude · 2026-02-10 · in Redefining Go Functions
  2. Other prior art: https://github.com/bouk/monkey with accompanying blog post https://bou.ke/blog/monkey-patching-in-go/
    comment by jerf · 2026-02-10 · in Redefining Go Functions
  3. https://github.com/bouk/monkey/blob/master/LICENSE.md Then why publish the blog post and put it into a package??
  4. …There was an HN thread[2] when it was released. [0] https://bou.ke/blog/monkey-patching-in-go/ [1] https://github.com/bouk/monkey [2] https://news.ycombinator.com/item?id=9290917
  5. …as unsafe as it sounds and I don't recommend anyone do it outside of a testing environment." [1]: https://github.com/bouk/monkey#i-thought-that-monkeypatching...
  6. Read the license before use the library: https://github.com/bouk/monkey/blob/master/LICENSE.md Caution! This approach is very dangerous, and not thread safe.
    comment by rodrigobrito · 2020-02-28 · in Monkey Patching in Golang (2015)