Registry / testing / agiledragon-gomonkey

agiledragon-gomonkey

JSON →
library2.0.2+incompatiblegogounverified

Package gomonkey provides monkey patching for Go functions and methods.

go get github.com/agiledragon/gomonkey
INSTALL
IMPORT
SIG · AGILEDRAGON-GOMONK
A
agiledragon-gomonkey
testinggov2.0.2+incompatible
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gomonkey
github.com/agiledragon/gomonkey

Patch a function for testing

package main import ( "fmt" "github.com/agiledragon/gomonkey" ) func original() string { return "original" } func main() { patches := gomonkey.ApplyFunc(original, func() string { return "patched" }) defer patches.Reset() fmt.Println(original()) }
Debug
Known issues
gotchagomonkey may not work with Go versions that have function inlining changes; test compatibility.
fix
Use go:linkname or upgrade to a version that supports your Go version.
affects: >=1.16
Upgrade
Version history
2.0.2+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
63 hits · last 30 days
node
52
Meta
1
OpenAI (training)
1
Resources