typeHelper

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Empty

func Empty(arg interface{}) bool

*

  • @func: Empty 判断目标是否为空值或0
  • @author Wiidz
  • @date 2019-11-16

func Explode

func Explode(data string, sep string) []interface{}

*

  • @func: Explode 字符串转slice, 接受混合类型
  • @author Wiidz
  • @date 2019-11-16

func ExplodeFloat64

func ExplodeFloat64(data string, sep string) []float64

*

  • @func: Explode 字符串转int slice
  • @author Wiidz
  • @date 2019-11-16

func ExplodeInt

func ExplodeInt(data string, sep string) []int

*

  • @func: Explode 字符串转int slice
  • @author Wiidz
  • @date 2019-11-16

func ExplodeInt64

func ExplodeInt64(data string, sep string) []int64

*

  • @func: Explode 字符串转int slice
  • @author Wiidz
  • @date 2019-11-16

func Float64Slice2IntSlice

func Float64Slice2IntSlice(slice []interface{}) []int

*

  • @func: Float64SliceToInt float64 slice转换成 int slice
  • @author Wiidz
  • @date 2019-11-16

func Float64ToStr

func Float64ToStr(number float64) string

*

  • @func: Str2Int 将字符串转为int
  • @author Wiidz
  • @date 2019-11-16

func GetType

func GetType(params interface{}) string

*

  • @func: GetType 获取目标的数据类型
  • @author Wiidz
  • @date 2019-11-16

func If

func If(conditions bool, trueVal, falseVal interface{}) interface{}

*

  • @func: If 三元运算符
  • @author Wiidz
  • @date 2019-11-16

func Implode

func Implode(data interface{}, glue string) string

*

  • @func: Implode 将slice转换成字符串
  • @author Wiidz
  • @date 2019-11-16

func Int2Str

func Int2Str(number int) string

*

  • @func: Float64SliceToInt float64 slice转换成 int slice
  • @author Wiidz
  • @date 2019-11-16

func Int64Slice2IntSlice

func Int64Slice2IntSlice(int64_slice []int64) []int

func Int64ToStr

func Int64ToStr(number int64) string

*

  • @func: Int64ToStr int64转为str
  • @author Wiidz
  • @date 2019-11-16

func InterfaceSlice2MapSlice

func InterfaceSlice2MapSlice(inter []interface{}) []map[string]interface{}

*

  • @func: InterfaceSlice2MapSlice interface slice 转换 map slice
  • @author Wiidz
  • @date 2019-11-16

func IsNil

func IsNil(i interface{}) bool

func IsType

func IsType(needle interface{}, type_name string) bool

*

  • @func: IsType 判断目标是否为指定类型的值
  • @author Wiidz
  • @date 2019-11-16

func JsonDecode

func JsonDecode(json_str string) map[string]interface{}

*

  • @func: JsonDecode 解码json
  • @author Wiidz
  • @date 2019-11-16

func JsonDecodeInt64Slice

func JsonDecodeInt64Slice(json_str string) []int64

*

  • @func: JsonDecode 解码json
  • @author Wiidz
  • @date 2019-11-16

func JsonDecodeWithStruct

func JsonDecodeWithStruct(json_str string, istruct interface{}) interface{}

*

  • @func: JsonDecode 解码json
  • @author Wiidz
  • @date 2019-11-16

func JsonEncode

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

*

  • @func: JsonEncode 编码json
  • @author Wiidz
  • @date 2019-11-16

func Map2InterfaceSlice

func Map2InterfaceSlice(data map[string]interface{}) []interface{}

*

  • @func: Map2InterfaceSlice 将map转换成interface slice
  • @author Wiidz
  • @date 2019-11-16

func Str2Float64

func Str2Float64(str string) float64

*

  • @func: Str2Float64 str转为float64
  • @author Wiidz
  • @date 2019-11-16

func Str2Int

func Str2Int(str string) int

*

  • @func: Str2Int 将字符串转为int
  • @author Wiidz
  • @date 2019-11-16

func Str2Int64

func Str2Int64(str string) int64

*

  • @func: Str2Int64 将字符串转为int64
  • @author Wiidz
  • @date 2019-11-16

func Str2Int8

func Str2Int8(str string) int8

*

  • @func: Str2Int8 将字符串转为int8
  • @author Wiidz
  • @date 2019-11-16

func StrSlice2InterfaceSlice

func StrSlice2InterfaceSlice(data []string) []interface{}

*

  • @func: StrSlice2InterfaceSlice 字符串slice转interface slice
  • @author Wiidz
  • @date 2019-11-16

func ToString

func ToString(data interface{}) string

*

  • @func: ToString 将任何参数转换为字符串
  • @author Wiidz
  • @date 2019-11-16

Types

This section is empty.

Jump to

Keyboard shortcuts

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