File
Blob: spec/vt.patch
| 1 | diff --git a/spec/protocol/chord.twirp.go b/spec/protocol/chord.twirp.go |
| 2 | index d9561c8..13eee81 100644 |
| 3 | --- a/spec/protocol/chord.twirp.go |
| 4 | +++ b/spec/protocol/chord.twirp.go |
| 5 | @@ -3432,8 +3437,8 @@ func withoutRedirects(in *http.Client) *http.Client { |
| 6 | } |
| 7 | |
| 8 | // doProtobufRequest makes a Protobuf request to the remote Twirp service. |
| 9 | -func doProtobufRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out proto.Message) (_ context.Context, err error) { |
| 10 | - reqBodyBytes, err := proto.Marshal(in) |
| 11 | +func doProtobufRequest(ctx context.Context, client HTTPClient, hooks *twirp.ClientHooks, url string, in, out vtMarshaler) (_ context.Context, err error) { |
| 12 | + reqBodyBytes, err := in.MarshalVT() |
| 13 | if err != nil { |
| 14 | return ctx, wrapInternal(err, "failed to marshal proto request") |
| 15 | } |
| 16 | @@ -3474,7 +3479,7 @@ func doProtobufRequest(ctx context.Context, client HTTPClient, hooks *twirp.Clie |
| 17 | return ctx, wrapInternal(err, "aborted because context was done") |
| 18 | } |
| 19 | |
| 20 | - if err = proto.Unmarshal(respBodyBytes, out); err != nil { |
| 21 | + if err = out.UnmarshalVT(respBodyBytes); err != nil { |
| 22 | return ctx, wrapInternal(err, "failed to unmarshal proto response") |
| 23 | } |
| 24 | return ctx, nil |
| 25 | diff --git a/spec/protocol/client_query.twirp.go b/spec/protocol/client_query.twirp.go |
| 26 | index ab7202e..2b5d6c3 100644 |
| 27 | --- a/spec/protocol/client_query.twirp.go |
| 28 | +++ b/spec/protocol/client_query.twirp.go |
| 29 | @@ -12,7 +12,6 @@ import strconv "strconv" |
| 30 | import strings "strings" |
| 31 | |
| 32 | import protojson "google.golang.org/protobuf/encoding/protojson" |
| 33 | -import proto "google.golang.org/protobuf/proto" |
| 34 | import twirp "github.com/twitchtv/twirp" |
| 35 | import ctxsetters "github.com/twitchtv/twirp/ctxsetters" |
| 36 | |
| 37 | diff --git a/spec/protocol/kv.twirp.go b/spec/protocol/kv.twirp.go |
| 38 | index bc9a25d..22e8da2 100644 |
| 39 | --- a/spec/protocol/kv.twirp.go |
| 40 | +++ b/spec/protocol/kv.twirp.go |
| 41 | @@ -12,7 +12,6 @@ import strconv "strconv" |
| 42 | import strings "strings" |
| 43 | |
| 44 | import protojson "google.golang.org/protobuf/encoding/protojson" |
| 45 | -import proto "google.golang.org/protobuf/proto" |
| 46 | import twirp "github.com/twitchtv/twirp" |
| 47 | import ctxsetters "github.com/twitchtv/twirp/ctxsetters" |
| 48 | |
| 49 | diff --git a/spec/protocol/tunnel.twirp.go b/spec/protocol/tunnel.twirp.go |
| 50 | index d4d6eeb..f750a35 100644 |
| 51 | --- a/spec/protocol/tunnel.twirp.go |
| 52 | +++ b/spec/protocol/tunnel.twirp.go |
| 53 | @@ -12,7 +12,6 @@ import strconv "strconv" |
| 54 | import strings "strings" |
| 55 | |
| 56 | import protojson "google.golang.org/protobuf/encoding/protojson" |
| 57 | -import proto "google.golang.org/protobuf/proto" |
| 58 | import twirp "github.com/twitchtv/twirp" |
| 59 | import ctxsetters "github.com/twitchtv/twirp/ctxsetters" |
| 60 | |
| 61 | diff --git a/spec/protocol/pki.twirp.go b/spec/protocol/pki.twirp.go |
| 62 | index d686366..c83c570 100644 |
| 63 | --- a/spec/protocol/pki.twirp.go |
| 64 | +++ b/spec/protocol/pki.twirp.go |
| 65 | @@ -12,7 +12,6 @@ import strconv "strconv" |
| 66 | import strings "strings" |
| 67 | |
| 68 | import protojson "google.golang.org/protobuf/encoding/protojson" |
| 69 | -import proto "google.golang.org/protobuf/proto" |
| 70 | import twirp "github.com/twitchtv/twirp" |
| 71 | import ctxsetters "github.com/twitchtv/twirp/ctxsetters" |
| 72 | |
| 73 | diff --git a/spec/protocol/keyless.twirp.go b/spec/protocol/keyless.twirp.go |
| 74 | index d686366..c83c570 100644 |
| 75 | --- a/spec/protocol/keyless.twirp.go |
| 76 | +++ b/spec/protocol/keyless.twirp.go |
| 77 | @@ -12,6 +12,5 @@ import strconv "strconv" |
| 78 | import strings "strings" |
| 79 | |
| 80 | import protojson "google.golang.org/protobuf/encoding/protojson" |
| 81 | -import proto "google.golang.org/protobuf/proto" |
| 82 | import twirp "github.com/twitchtv/twirp" |
| 83 | import ctxsetters "github.com/twitchtv/twirp/ctxsetters" |