Documentation
¶
Index ¶
- func First(slice interface{}, idx int) (interface{}, error)
- func FirstString(slice interface{}, idx int) (string, error)
- func Get(slice interface{}, idx int) interface{}
- func GetString(slice interface{}, idx int) string
- func Is(arg interface{}) bool
- func Shuffle(slice []interface{})
- func ToAny(slice interface{}) ([]interface{}, bool)
- func ToFloat64(slice []interface{}) []float64
- func ToInt(slice []interface{}) []int
- func ToPossibleInt(slice []interface{}) []int
- func ToString(slice []interface{}) []string
- func UniqueString(vals ...string) []string
- func UniqueUint(vals ...uint) []uint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstString ¶
FirstString 从切片中按下标取值,并转化成字符串
func Get ¶
func Get(slice interface{}, idx int) interface{}
Get 从切片中按下标取值 如果 any 不是切片,则返回 nil 如果下标越界,则返回 nil 如果需要返回错误,请使用 First
func ToPossibleInt ¶
func ToPossibleInt(slice []interface{}) []int
ToPossibleInt 尽可能的转成 []int 切片 如:[]interface{}{1, "2", "b", "c", "", "3.0", "4.62"} => []int{1, 2, 3, 4}
func UniqueString ¶ added in v1.0.4
func UniqueUint ¶ added in v1.0.4
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.