Registry / testing / alangpierce-go-forceexport

alangpierce-go-forceexport

JSON →
library0.0.0-20160317203124-8f1d6941cd75gogounverified

A Go library that uses unsafe tricks to export unexported functions and variables for testing.

go get github.com/alangpierce/go-forceexport
INSTALL
IMPORT
SIG · ALANGPIERCE-GO-FOR
A
alangpierce-go-forceexport
testinggov0.0.0-20160317203124-8f1d6941cd75
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.

forceexport
github.com/alangpierce/go-forceexport

Exports and calls the unexported runtime.GC function.

package main import "github.com/alangpierce/go-forceexport" func main() { var fn func() forceexport.GetFunc(&fn, "runtime.GC") fn() }
Debug
Known issues
gotchaUses unsafe and reflect; may break with Go version updates.
fix
Use only for testing; avoid in production code.
affects: all
Upgrade
Version history
0.0.0-20160317203124-8f1d6941cd75latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
47 hits · last 30 days
node
38
OpenAI (training)
1
Resources
alangpierce-go-forceexport — go get alangpierce-go-forceexport · libregistry