array 增加 to string slice
This commit is contained in:
parent
ee726ea6bc
commit
8c922be06d
14
array.go
14
array.go
@ -231,6 +231,20 @@ func (at *Array) ConvertIgnoreError() []interface{} {
|
||||
return res
|
||||
}
|
||||
|
||||
// ToStringSlice ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 11:42 2024/4/22
|
||||
func (at *Array) ToStringSlice() []string {
|
||||
res := at.ConvertIgnoreError()
|
||||
list := make([]string, 0)
|
||||
for _, item := range res {
|
||||
list = append(list, fmt.Sprintf("%v", item))
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
// Unique 对数据结果进行去重
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Loading…
Reference in New Issue
Block a user