Registry / utility / jtolds-gls

jtolds-gls

JSON →
library4.20.0+incompatiblegogounverified

Package gls implements goroutine-local storage for Go.

go get github.com/jtolds/gls
INSTALL
IMPORT
SIG · JTOLDS-GLS
J
jtolds-gls
utilitygov4.20.0+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.

gls
github.com/jtolds/gls

Sets and gets a value in goroutine-local storage.

package main import ( "fmt" "github.com/jtolds/gls" ) func main() { mgr := gls.NewContextManager() mgr.SetValue("key", "value") val := mgr.GetValue("key") fmt.Println(val) }
Debug
Known issues
gotchaGoroutine-local storage can lead to subtle bugs if not used carefully.
fix
Prefer passing context.Context explicitly instead of relying on GLS.
affects: all
Upgrade
Version history
4.20.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
jtolds-gls — go get jtolds-gls · libregistry