Documentation ¶
Overview ¶
Package utils are utilities helpers for gexpo.
Index ¶
- Constants
- func CheckPath(path string) bool
- func CommandExist(command string) bool
- func Fatalf(format string, v ...interface{})
- func GetJson(url string, result interface{}) error
- func GetRaw(url string) ([]byte, error)
- func NewSpinner() *yacspin.Spinner
- func ReadFile(target string) ([]byte, error)
- func ReadJson(target string, result interface{}) error
- func ReadJsonUseNumber(target string, result interface{}) error
- func WriteFile(target string, data []byte) error
- func WriteJson(target string, data interface{}) error
- type Cl
Constants ¶
View Source
const FgGreen = "\033[32m"
FgGreen is green foreground color.
View Source
const FgRed = "\033[31m"
FgRed is red foreground color.
View Source
const FgYellow = "\033[33m"
FgYellow is yellow foreground color.
Variables ¶
This section is empty.
Functions ¶
func CommandExist ¶
CommandExist will check if command exist or not.
func ReadFile ¶
ReadFile will read a file. Params target is the full path of the file. The result will be returned as []byte
func ReadJson ¶
ReadJson will read json file. Params target is the full path of the file. Params result is interface of the file.
func ReadJsonUseNumber ¶ added in v0.1.2
ReadJsonUseNumber will read json file and use json.Number instead float64 for number inside json. Params target is the full path of the file. Params result is interface of the file.
Types ¶
Click to show internal directories.
Click to hide internal directories.