|
|
|
|
|
by dmitriid
1759 days ago
|
|
> if you're writing a web application for example, maybe you don't really need generics much All our microservices return a { result: ... } or a { result: ..., nextPageToken } We would definitely benefit from generic SingleResult<T> and PagedResult<T>. Instead, you copy-paste the same definitions over, and over, and over, and over again for every call. |
|
Let me conclude with a recommendation for gRPC and gRPC-gateway as a bridge to clients that don't want to speak gRPC. Then you can just return a "stream Foo", and the hard work is done for you. You call stream.Next() and get a Foo object ;)