Documentation ¶
Index ¶
- func Bytes2String(b []byte) string
- func CompareVersion(src, dst string) int
- func FillZero(sl []string, i int) []string
- func GetRandomString(l int) string
- func Hash(v interface{}) (uint64, error)
- func MustHash(v interface{}) uint64
- func ObjByAnchor(str, anchor string) interface{}
- func Parse(str string, v interface{}) error
- func ParseByBytes(bytes []byte, v interface{}) error
- func ParseFromYaml(str string, v interface{}) error
- func RandStringBytesMaskImpr(n int) []byte
- func String2Bytes(s string) []byte
- func ToJsonStr(obj interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bytes2String ¶
Bytes2String直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变。 效率是string([]byte{})的百倍以上,且转换量越大效率优势越明显。
func CompareVersion ¶
版本比较, src > dst 返回 1 src = dst 返回 0 src < dst 返回 -1
func Hash ¶ added in v1.0.1
Hash returns the xxhash of an arbitrary value or struct. NOT SUITABLE FOR CRYTOGRAPHIC HASHING.
func MustHash ¶ added in v1.0.1
func MustHash(v interface{}) uint64
MustHash returns the xxhash of an arbitrary value or struct. Returns 0 on error. NOT SUITABLE FOR CRYTOGRAPHIC HASHING.
func ObjByAnchor ¶
func ObjByAnchor(str, anchor string) interface{}
func ParseByBytes ¶
func ParseFromYaml ¶
func String2Bytes ¶
String2Bytes直接转换底层指针,两者指向的相同的内存,改一个另外一个也会变。 效率是string([]byte{})的百倍以上,且转换量越大效率优势越明显。 转换之后若没做其他操作直接改变里面的字符,则程序会崩溃。 如 b:=String2bytes("xxx"); b[1]='d'; 程序将panic。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.