Skip to content

go-leap/sys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

usys

-- import "github.com/go-leap/sys"

Usage

var (
	// Env aliases `os.Getenv` — merely a handy short-hand during rapid iteration in non-critical code-paths that already do import `usys` to not have to repeatedly pull in and out the extra `os` import.
	Env = os.Getenv
)

func Arg

func Arg(i int) (argValOrEmpty string)

Arg returns os.Args[i] if bounds allow.

func EnvBool

func EnvBool(name string, defaultValue bool) bool

EnvBool returns defaultValue unless there was an environment variable with the given name and a value that strconv.ParseBooled successfully.

func OnSigint

func OnSigint(do func())

OnSigint listens for os.Interrupt.

func UserDataDirPath

func UserDataDirPath(preferCacheOverConfig bool) string

UserDataDirPath looks for the user's local configuration or cache directory, probing for a variety of common folder-name idioms and environment variables. If no match, it returns the result of UserHomeDirPath.

func UserHomeDirPath

func UserHomeDirPath() string

UserHomeDirPath returns the path to the current user's Home directory. It remains cached in-memory after the first call.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages