Documentation ¶
Index ¶
- Variables
- func Environ() map[string]string
- func Getenv(name string, def ...string) string
- func HasShellEnv(shell string) bool
- func IsConsole(out io.Writer) 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) (newVal string)
- func StdIsTerminal() bool
- func VarParse(str string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ValueGetter = os.Getenv
ValueGetter Env value provider func. TIPS: you can custom provide data.
View Source
var VarReplace = os.ExpandEnv
VarReplace replaces ${var} or $var in the string according to the values
Functions ¶
func Environ ¶ added in v0.4.1
Environ like os.Environ, but will returns key-value map[string]string data.
func IsSupportColor ¶
func IsSupportColor() bool
IsSupportColor check current console is support color.
Supported:
linux, mac, or windows's ConEmu, Cmder, putty, git-bash.exe
Not support:
windows cmd.exe, powerShell.exe
func IsSupportTrueColor ¶ added in v0.4.1
func IsSupportTrueColor() bool
IsSupportTrueColor render. IsSupportRGBColor
func IsWSL ¶ added in v0.4.1
func IsWSL() bool
IsWSL system env https://github.com/Microsoft/WSL/issues/423#issuecomment-221627364
func ParseEnvValue ¶ added in v0.4.1
ParseEnvValue parse ENV var value from input string, support default value.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.