envutil

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: MIT Imports: 6 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Getenv added in v0.1.7

func Getenv(name string, def ...string) string

Getenv get ENV value by key name

func HasShellEnv

func HasShellEnv(shell string) bool

HasShellEnv has shell env check. Usage:

HasShellEnv("sh")
HasShellEnv("bash")

func IsConsole

func IsConsole(out io.Writer) bool

IsConsole 判断 w 是否为 stderr、stdout、stdin 三者之一

func IsLinux

func IsLinux() bool

IsLinux system

func IsMSys

func IsMSys() bool

IsMSys msys(MINGW64) 环境,不一定支持颜色

func IsMac

func IsMac() bool

IsMac system

func IsSupport256Color

func IsSupport256Color() bool

IsSupport256Color is support 256 color

func IsSupportColor

func IsSupportColor() bool

IsSupportColor check console is support color. supported: linux, mac, or windows's ConEmu, Cmder, putty, git-bash.exe not support: windows cmd, powerShell

func IsWin

func IsWin() bool

IsWin system. linux windows darwin

func ParseEnvValue added in v0.1.7

func ParseEnvValue(val string) (newVal string)

ParseEnvValue parse ENV var value from input string

Types

This section is empty.

Jump to

Keyboard shortcuts

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