tkcashgame_v4/pkg/marshal/json.go

12 lines
214 B
Go
Raw Permalink Normal View History

2025-10-22 10:01:11 +00:00
package marshal
import "encoding/json"
func ConvertStructToOtherType(src interface{}, dst interface{}) error {
data, err := json.Marshal(src)
if err != nil {
return err
}
return json.Unmarshal(data, dst)
}