Back to

Package grail

Latest Go to latest
Published: Jun 24, 2020 | License: Apache-2.0 | Module:


Package grail contains the Init function that all programs are expected to call.


Package Files

type Shutdown

type Shutdown func()

Shutdown is a function that needs to be called to perform the final cleanup.

func Init

func Init() Shutdown

Init should be called once at the beginning at each executable that doesn't use the The Shutdown function should be called to perform the final cleanup (closing logs for example).

Init also applies a default configuration profile (see package, and adds profile flags to the default flag set. The default profile path used is $HOME/grail/profile.

Note that this function will call flag.Parse().

Suggested use:

shutdown := grail.Init()
defer shutdown()
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier