utils

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilePerm = 0644
	DirPerm  = 0755
)

Variables

Functions

func Check added in v0.0.4

func Check(err error)

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

func ColorBg added in v0.2.13

func ColorBg(val, color string) string

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 PrintlnWithColor added in v0.3.1

func PrintlnWithColor(a ...interface{})

PrintlnWithColor fix the color of the output on Windows.

func RandomColor added in v0.2.0

func RandomColor(in string) string

func ReadLines added in v0.3.0

func ReadLines(filePath string) (lines []string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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