util

package
v0.0.0-...-b102549 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(s string) ([]byte, error)

func Base64Encode

func Base64Encode(data []byte) string

func Marshal64

func Marshal64(data interface{}) (string, error)

Marshal64 converts data to json and encodes to base64 string.

func NoCaseContains

func NoCaseContains(s, substr string) bool

NoCaseContains reports whether substr is within s case-insensitive.

func Panic

func Panic(err error)

Panic panics if err != nil

func PathIsExist

func PathIsExist(name string) bool

func PathIsNotExist

func PathIsNotExist(name string) (ok bool)

func RandomBytes

func RandomBytes(size int) []byte

func RandomString

func RandomString(size int) string

RandomString 的 size 不是最终长度

func TimeNow

func TimeNow() int64

func Unmarshal64_Wrong

func Unmarshal64_Wrong(data64 string, value interface{}) error

Unmarshal64_Wrong 是一个错误的的函数,不可使用! 因为 value 是值,不是指针,因此 &value 无法传出去。

func WrapErrors

func WrapErrors(allErrors ...error) (wrapped error)

WrapErrors 把多个错误合并为一个错误.

Types

This section is empty.

Jump to

Keyboard shortcuts

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