Skip to content

Latest commit

 

History

History
 
 

envutil

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Env Util

Provide some commonly system or go ENV util functions.

Install

go get github.com/gookit/goutil/envutil

Go docs

Functions API

Note: doc by run go doc ./envutil

func Environ() map[string]string
func GetBool(name string, def ...bool) bool
func GetInt(name string, def ...int) int
func Getenv(name string, def ...string) string
func HasShellEnv(shell string) bool
func IsConsole(out io.Writer) bool
func IsGithubActions() bool
func IsLinux() bool
func IsMSys() bool
func IsMac() bool
func IsSupport256Color() bool
func IsSupportColor() bool
func IsSupportTrueColor() bool
func IsTerminal(fd uintptr) bool
func IsWSL() bool
func IsWin() bool
func IsWindows() bool
func ParseEnvValue(val string) string
func ParseValue(val string) (newVal string)
func SetEnvs(mp map[string]string)
func StdIsTerminal() bool
func VarParse(val string) string
func VarReplace(s string) string

Code Check & Testing

gofmt -w -l ./
golint ./...

Testing:

go test -v ./envutil/...

Test limit by regexp:

go test -v -run ^TestSetByKeys ./envutil/...