package api import ( "encoding/json" ) func unmarshal[T any](data []byte) (*T, error) { var r T err := json.Unmarshal(data, &r) return &r, err }