exit

package
v0.0.0-...-f022186 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(desc string, fn func())

Add registers a function to be called on exit.

func Exit

func Exit(code int)

Exit calls RunFuncs and then os.Exit It also starts a failsafe timer which will exit in 10 seconds regardless.

func RunFuncs

func RunFuncs()

RunFuncs runs the Add'ed exit functions. Only the first caller will run them, any other callers will block. The functions are run in the reverse order that they were Add'ed.

func Wait

func Wait()

Wait should only be called after Exit or RunFuncs. It blocks until exit.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL