Documentation ¶
Index ¶
- func DiffList(currentList interface{}, beforeList interface{}, ChoiceFields interface{}) (diffList []interface{}, sameList []interface{}, ok bool)
- func FindIndexInDataList(datalist interface{}, data interface{}, fieldList []string) (index int, result bool)
- func Head(dataList interface{}, n int)
- func IsDataInStrList(data []string, item string) bool
- func IsDataInStructList(datalist interface{}, data interface{}, choiceFields []string) (index int, result bool)
- func Merge(...interface{})
- func Reverse(dataList interface{})
- func Sort(dataList interface{}, column interface{}, desc bool)
- func StructListToMap(obj interface{}, fields interface{}) (map[string]interface{}, bool)
- func Tail(dataList interface{}, n int)
- func ToString(array interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffList ¶
func DiffList(currentList interface{}, beforeList interface{}, ChoiceFields interface{}) (diffList []interface{}, sameList []interface{}, ok bool)
* @Function:DiffList @Description: 与另一个结构体数组/切片对比,获取相同值和不同值。 @Param: currentList 当前的结构体数组/切片 @Param: beforeList 需要对比的结构体数字/切片 @Param: fields (string/list/slice/nil)对比哪几个字段,传nil为对比所有数据 @Return: diffList 不同部分 @Return: sameList 相同部分 @Return: ok true/false 成功/失败 @author:JunjieXu @Time:2021/12/24
func FindIndexInDataList ¶
func FindIndexInDataList(datalist interface{}, data interface{}, fieldList []string) (index int, result bool)
@Function:FindIndexInDataList @Description:查询数据在切片/列表中的索引,就是Isdatainlist函数起得别名 @Param: datalist 类型:interface{},传入切片值 @Param: data 类型:interface{},传入要查询的数据,一般为与datalist中元素一直的结构体 @Param: fieldList []string.需要对比的字段,注意这是一个切片. 传nil为完全对比 @Return: index int 数据在列表中的索引 @Return: result bool 数据是否在列表中 @author:JunjieXu @Time:2021/12/22
func IsDataInStrList ¶
func IsDataInStructList ¶
func IsDataInStructList(datalist interface{}, data interface{}, choiceFields []string) (index int, result bool)
@Function:IsDataInStructList @Description:判断数据是否在切片/列表中 @Param: datalist 类型:interface{},传入切片值 @Param: data 类型:interface{},传入要查询的数据,一般为与datalist中元素一直的结构体 @Param: choiceFields []string.需要对比的字段,注意这是一个切片. 传nil为完全对比 @Return: index int 数据在列表中的索引 @Return: result bool 数据是否在列表中 @author:JunjieXu @Time:2021/12/22
func StructListToMap ¶
* @Function:StructListToMap @Description: 结构体列表转字典 @Param: obj (结构体对象) @Param: fields (string/list/nil) 以哪几个字段的值组成key,传nil为所有 @Return: result map数据 @Return: ok false/ture 失败/成功 @author:JunjieXu @Time:2021/12/24
func ToString ¶
func ToString(array interface{}) string
@author: [piexlmax](https://github.com/piexlmax) @function: ArrayToString @description: 将数组格式化为字符串 @param: array []interface{} @return: string
Types ¶
This section is empty.