Registry / utility / tomb-v1

tomb-v1

JSON →
library1.0.0-20141024135613-dd632973f1e7gogounverified

The tomb package offers a conventional API for clean goroutine termination.

go get gopkg.in/tomb.v1
INSTALL
IMPORT
SIG · TOMB-V1
T
tomb-v1
utilitygov1.0.0-20141024135613-dd632973f1e7
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.

tomb
gopkg.in/tomb.v1

Start a goroutine that terminates cleanly when the tomb is killed

package main import ( "fmt" "time" "gopkg.in/tomb.v1" ) func main() { t := &tomb.Tomb{} go func() { defer t.Done() select { case <-t.Dying(): fmt.Println("goroutine dying") } }() t.Kill(nil) err := t.Wait() fmt.Println(err) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.0-20141024135613-dd632973f1e7latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
tomb-v1 — go get tomb-v1 · libregistry