bouk/monkey
Monkey patching in Go observed · 2026-08-28
Health v2 · maintenance only
10/100
- Activity 0
- Release rhythm 35
- Longevity 100
Flags: no_releases archived no_license
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 4176
- days_rel: n/a
- days_push: 2268
- n_releases_24m: 0
Adoption not part of the score
3424 stars · 363 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
A Go library that enables monkey patching of functions and instance methods at runtime by rewriting the running executable to insert jumps to replacement functions. It is explicitly intended for use in testing environments only, as the technique is inherently unsafe.
Use cases
- monkey patch functions in Go tests
- mock net.Dial to disable network access in tests
- replace fmt.Println with a stub during testing
- patch instance methods for all instances of a type
- call the original function from within a replacement using PatchGuard
- unpatch all replacements in test teardown
When to choose
- you need to stub out functions or methods in Go tests that cannot be injected via interfaces
- you want to disable network or side effects in integration tests
- you need to intercept calls to third-party functions you cannot modify
When to avoid
- in production code, since runtime executable rewriting is unsafe
- on platforms where the binary rewriting technique is unsupported
- you need to patch a method for only a single instance
- your project requires a permissive or standard license (license is non-standard)
Facets
library · maturity maintenance
testing mocking developer-tools developer-tools testing go monkey-patching runtime-patching test-doubles unsafe linux macos
3 sources
- readme: https://github.com/bouk/monkey · fetched 2026-08-28 · 78c10eaa6c09
- homepage: https://bou.ke · fetched 2026-08-29 · b2422ce3be5b
- site_page: https://bou.ke/about · fetched 2026-08-29 · 0db175128aa0
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| bouk/monkey | main | 10 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem