utils

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Color = []string{
	"\u001b[31;1m",
	"\u001b[32;1m",
	"\u001b[33;1m",
	"\u001b[34;1m",
	"\u001b[35;1m",
	"\u001b[36;1m",
	"\u001b[37;1m",
}

Color base 8color Black: \u001b[30m Red: \u001b[31m Green: \u001b[32m Yellow: \u001b[33m Blue: \u001b[34m Magenta: \u001b[35m Cyan: \u001b[36m White: \u001b[37m Reset: \u001b[0m

Functions

func Check added in v0.0.4

func Check(err error)

Check : return the error message if the err is not nil

func ColorFg added in v0.2.6

func ColorFg(val, color string) string

func Err added in v0.0.3

func Err(msg ...interface{})

Err : return the error message,then exit

func FileExists added in v0.1.4

func FileExists(path string) bool

func GetEnv added in v0.0.4

func GetEnv(key, fallback string) string

GetEnv : get env, if not exist use fallback value

func OpenBrowser added in v0.0.8

func OpenBrowser(url string) error

OpenBrowser open the url in web browser

func RandomColor added in v0.2.0

func RandomColor(in string) (out string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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