Documentation ¶
Index ¶
- func ExecCmd(binName string, args []string, workDir ...string) (string, error)
- func ExecCommand(cmdStr string, dirAndShell ...string) (string, error)
- func GetCurShell(onlyName bool) string
- func GetKeyMaxLen(kv map[string]interface{}, defLen int) (max int)
- func GetScreenSize() (w int, h int)
- func Go(f func() error) chan error
- 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 IsWin() bool
- func LcFirst(s string) string
- func RenderTemplate(input string, data interface{}, isFile ...bool) string
- func ShellExec(cmdStr string, dirAndShell ...string) (string, error)
- func UcFirst(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecCommand ¶
ExecCommand alias of the ShellExec
func GetCurShell ¶
GetCurShell get current used shell env file. eg "/bin/zsh" "/bin/bash"
func GetKeyMaxLen ¶
GetKeyMaxLen get key max length of the map usage:
utils.GetKeyMaxLen(map[string]string{"k1":"v1", "key2": "v2"}, 0)
func Go ¶
Go is a basic promise implementation: it wraps calls a function in a goroutine and returns a channel which will later return the function's return value. from beego/bee
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 RenderTemplate ¶
RenderTemplate render text template with data
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.