utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(bytes []byte) string

BytesToString convert bytes to string

func FileExist

func FileExist(name string) (existed bool, isDir bool)

FileExist reports whether the named file or directory exists.

func FileExists

func FileExists(name string) (existed bool)

FileExists reports whether the named file or directory exists.

func FileMode

func FileMode(path string) os.FileMode

FileMode get file mode

func HandleHomedir

func HandleHomedir(filePath string) string

HandleHomedir replace ~ with homeDir

func IsTesting

func IsTesting() bool

IsTesting is testing

func JSONToMap

func JSONToMap(jsonStr string) (map[string]string, error)

JSONToMap json string to map

func MapToJSON

func MapToJSON(m map[string]string) (string, error)

MapToJSON map to json string

func RunBashCommand

func RunBashCommand(cmd string) (err error)

RunBashCommand run bash command

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes convert string to bytes

func WriteStringToFile

func WriteStringToFile(content, path string, mode os.FileMode) (err error)

WriteStringToFile write string to file

Types

This section is empty.

Jump to

Keyboard shortcuts

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