增加str -> []interface

This commit is contained in:
zhangdeman committed 2023-05-05 15:02:45 +08:00
1 parent 5e785171ed
commit b182b21e03
1 file changed
+17
+17
View File
@@ -655,3 +655,20 @@ func (str String) ToDoubleSlice(splitChar ...string) ([]float64, error) {
func (str String) ToNumberSlice(splitChar ...string) ([]float64, error) {
return str.ToFloat64Slice(splitChar...)
}
// ToAnySlice ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 15:01 2023/5/5
func (str String) ToAnySlice() ([]interface{}, error) {
var (
err error
res []interface{}
)
if err = util.JSON.UnmarshalWithNumber([]byte(str), &res); nil != err {
return nil, err
}
return res, nil
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.