Documentation ¶
Index ¶
- Variables
- func Bool(any interface{}) bool
- func Byte(any interface{}) byte
- func Bytes(any interface{}) []byte
- func Float32(any interface{}) float32
- func Float64(any interface{}) float64
- func Int(any interface{}) int
- func Int16(any interface{}) int16
- func Int32(any interface{}) int32
- func Int64(any interface{}) int64
- func Int8(any interface{}) int8
- func String(any interface{}) string
- func Uint(any interface{}) uint
- func Uint16(any interface{}) uint16
- func Uint32(any interface{}) uint32
- func Uint64(any interface{}) uint64
- func Uint8(any interface{}) uint8
- func UnsafeBytesToStr(b []byte) string
- func UnsafeStrToBytes(s string) []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StructTagPriority defines the default priority tags for Map*/Struct* functions. // Note, the "gconv", "param", "params" tags are used by old version of package. // It is strongly recommended using short tag "c" or "p" instead in the future. StructTagPriority = []string{"gconv", "param", "params", "c", "p", "json"} )
Functions ¶
func Bool ¶
func Bool(any interface{}) bool
Bool converts `any` to bool. It returns false if `any` is: false, "", 0, "false", "off", "no", empty slice/map.
func String ¶
func String(any interface{}) string
String converts `any` to string. It's most commonly used converting function.
func UnsafeBytesToStr ¶
UnsafeBytesToStr converts []byte to string without memory copy. Note that, if you completely sure you will never use `b` variable in the feature, you can use this unsafe function to implement type conversion in high performance.
func UnsafeStrToBytes ¶
UnsafeStrToBytes converts string to []byte without memory copy. Note that, if you completely sure you will never use `s` variable in the feature, you can use this unsafe function to implement type conversion in high performance.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.