Files
re4-biorand-reseed/json_ex/json.go
2024-11-28 23:38:39 +01:00

12 lines
215 B
Go

package json_ex
import "encoding/json"
func GenericUnmarshal[T any](source []byte) (T, error) {
var target T
if err := json.Unmarshal(source, &target); err != nil {
return target, err
}
return target, nil
}