type OrderRevenue interface {
MarshalMyself() ([]byte, error)
}
type Anonymous struct {}
func (a Anonymous) MarshalMyself() ([]byte, error) {
// implementation's up to you
return []byte{}, nil
}
// the function signature
generateResponse(rows *sqlx.Rows, structSlice []OrderRevenue, structBody Body) ([]Body, error) {
// ...
}
Created
March 24, 2022 02:27
-
-
Save curlyz/4c185c1d0bab1245957e069c812f7309 to your computer and use it in GitHub Desktop.
go_generic_struct
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment