Documentation ¶
Index ¶
- Constants
- Variables
- func All(actions ...func())
- func C(str interface{}, color string) string
- func ClearScreen() error
- func Dump(val interface{})
- func E(args ...interface{}) []interface{}
- func E1(arg interface{}, err error) interface{}
- func Err(v ...interface{})
- func ErrArg(args ...interface{}) error
- func JSON(data interface{}) (res gjson.Result)
- func Log(v ...interface{})
- func MustToJSON(data interface{}) string
- func MustToJSONBytes(data interface{}) []byte
- func Noop(_ ...interface{})
- func RandBytes(len int) []byte
- func RandString(len int) string
- func S(tpl string, params ...interface{}) string
- func Sdump(val interface{}) string
- func Try(fn func()) (err interface{})
- type Nil
Constants ¶
View Source
const Version = "v0.16.6"
Version version the project
Variables ¶
View Source
var Stderr = ansi.NewAnsiStderr()
Stderr ...
View Source
var Stdout = ansi.NewAnsiStdout()
Stdout ...
Functions ¶
func E1 ¶
func E1(arg interface{}, err error) interface{}
E1 if the second arg is error panic it, or return the first arg
func MustToJSON ¶ added in v0.16.3
func MustToJSON(data interface{}) string
MustToJSON encode data to json string
func MustToJSONBytes ¶ added in v0.16.3
func MustToJSONBytes(data interface{}) []byte
MustToJSONBytes encode data to json bytes
func RandString ¶
RandString generate random string with specified string length
Types ¶
Click to show internal directories.
Click to hide internal directories.