mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-10-05 07:56:50 +08:00
support push item choice
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"regexp"
|
||||
@@ -76,3 +77,9 @@ func (k *KVStr) Build() string {
|
||||
}
|
||||
return strings.Join(strList, " , ")
|
||||
}
|
||||
|
||||
func JsonStrToStruct[T any](str string) T {
|
||||
var data T
|
||||
json.Unmarshal([]byte(str), &data)
|
||||
return data
|
||||
}
|
||||
|
Reference in New Issue
Block a user