Help us shape the future of Go! Take the 2026 Go Developer Survey

tool

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToStr

func ByteToStr(b []byte) string

ByteToStr 高效转换,避免内存拷贝,

func CallMethod

func CallMethod(v interface{}, methodName string) (interface{}, bool)

func Interpret

func Interpret(a interface{}) interface{}

func IsStrType

func IsStrType(v interface{}) (bool, string)

func JsonChecker

func JsonChecker(v interface{}) (bool, string)

StrChecker 判断v是不是一个字符串类型,首先判断是否为字符串,其次判断是否为json

func JsonDumps

func JsonDumps(m interface{}) (string, error)

func JsonLoadsList

func JsonLoadsList(jsonStr string) ([]interface{}, error)

JsonLoadsList

func JsonLoadsMap

func JsonLoadsMap(jsonStr string) (map[string]interface{}, error)

JsonLoadsMap Tip: map类型的json key必须是字符串;

func JsonLoadsObj

func JsonLoadsObj(jsonStr string, o interface{}) (interface{}, error)

JsonLoadsObj 注:o必须是对象的指针

func JsonUnmarshalObj

func JsonUnmarshalObj(jsonStr string, o interface{}) (interface{}, error)

JsonUnmarshalObj 注:o必须是对象的指针

func StrToByte

func StrToByte(s string) (b []byte)

StrToByte 高效转换,避免内存拷贝

func ToStr

func ToStr(v interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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