feat: finish adding chat role to user function

This commit is contained in:
RockYang
2023-10-16 06:56:42 +08:00
parent 80e2b34abc
commit d2a8d655c8
5 changed files with 178 additions and 12 deletions

View File

@@ -36,7 +36,7 @@ func CopyObject(src interface{}, dst interface{}) error {
pType := reflect.New(value.Type())
v2 := pType.Interface()
err := json.Unmarshal([]byte(v.String()), &v2)
if err == nil {
if err == nil && v2 != nil {
value.Set(reflect.ValueOf(v2).Elem())
}
// map, struct, slice to string