connectrpc / connect-go

The Go implementation of Connect: Protobuf RPC that works.
https://connectrpc.com
Apache License 2.0
2.76k stars 91 forks source link

Remove redundant work when validating unary Connect response #683

Closed mattrobenolt closed 5 months ago

mattrobenolt commented 5 months ago

We can swap TrimPrefix for just a string slice here since we're already guarding behind HasPrefix. TrimPrefix internally runs HasPrefix again, so we can just skip the redundant work.