11 lines
217 B
Go
11 lines
217 B
Go
package utils
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
func Strcut2Map[S any, T *map[string]interface{} | *[]map[string]interface{}](source S, target T) {
|
|
jsonByte, _ := json.Marshal(source)
|
|
json.Unmarshal(jsonByte, target)
|
|
}
|