From 76d8eaf363fba5a43276fda8079cf694ad94a928 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 26 Jun 2023 17:33:43 +0530 Subject: [PATCH 01/86] add Error interface and implementation --- runtime/error.go | 32 +++++++++++++++ runtime/error_builder.go | 81 +++++++++++++++++++++++++++++++++++++ runtime/errortype_string.go | 26 ++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 runtime/error.go create mode 100644 runtime/error_builder.go create mode 100644 runtime/errortype_string.go diff --git a/runtime/error.go b/runtime/error.go new file mode 100644 index 000000000..3b7e06493 --- /dev/null +++ b/runtime/error.go @@ -0,0 +1,32 @@ +package zanzibar + +// ErrorType is used for error grouping. +type ErrorType int + +const ( + // TChannelError are errors of type tchannel.SystemError + TChannelError ErrorType = iota + 1 + // ClientException are client exceptions defined in the + // client IDL. + ClientException + // BadResponse are errors reading client response such + // as undefined exceptions, empty response. + BadResponse +) + +//go:generate stringer -type=ErrorType + +// Error extends error interface to set meta fields about +// error that are logged to improve error debugging, as well +// as to facilitate error grouping and filtering in logs. +type Error interface { + error + // ErrorLocation is used for logging. It is the module + // identifier that produced the error. It should be one + // of client, middleware, endpoint. + ErrorLocation() string + // ErrorType is for error grouping. + ErrorType() ErrorType + // Unwrap to enable usage of func errors.As + Unwrap() error +} diff --git a/runtime/error_builder.go b/runtime/error_builder.go new file mode 100644 index 000000000..cde0a6a3b --- /dev/null +++ b/runtime/error_builder.go @@ -0,0 +1,81 @@ +package zanzibar + +import "go.uber.org/zap" + +const ( + logFieldErrorLocation = "errorLocation" + logFieldErrorType = "errorType" +) + +// ErrorBuilder provides useful functions to use Error. +type ErrorBuilder interface { + Error(err error, errType ErrorType) Error + LogFieldErrorLocation(err error) zap.Field + LogFieldErrorType(err error) zap.Field +} + +// NewErrorBuilder creates an instance of ErrorBuilder. +// Input module id is used as error location for Errors +// created by this builder. +// +// PseudoErrLocation is prefixed with "~" to identify +// logged error that is not created in the present module. +func NewErrorBuilder(moduleClassName, moduleName string) ErrorBuilder { + return zErrorBuilder{ + errLocation: moduleClassName + "::" + moduleName, + pseudoErrLocation: "~" + moduleClassName + "::" + moduleName, + } +} + +type zErrorBuilder struct { + errLocation, pseudoErrLocation string +} + +type zError struct { + error + errLocation string + errType ErrorType +} + +var _ Error = (*zError)(nil) +var _ ErrorBuilder = (*zErrorBuilder)(nil) + +func (zb zErrorBuilder) Error(err error, errType ErrorType) Error { + return zError{ + error: err, + errLocation: zb.errLocation, + errType: errType, + } +} + +func (zb zErrorBuilder) toError(err error) Error { + if zerr, ok := err.(Error); ok { + return zerr + } + return zError{ + error: err, + errLocation: zb.pseudoErrLocation, + } +} + +func (zb zErrorBuilder) LogFieldErrorLocation(err error) zap.Field { + zerr := zb.toError(err) + return zap.String(logFieldErrorLocation, zerr.ErrorLocation()) +} + +func (zb zErrorBuilder) LogFieldErrorType(err error) zap.Field { + zerr := zb.toError(err) + return zap.String(logFieldErrorType, zerr.ErrorType().String()) +} + +func (e zError) Unwrap() error { + return e.error +} + +func (e zError) ErrorLocation() string { + return e.errLocation +} + +func (e zError) ErrorType() ErrorType { + return e.errType +} diff --git a/runtime/errortype_string.go b/runtime/errortype_string.go new file mode 100644 index 000000000..bf30e8d28 --- /dev/null +++ b/runtime/errortype_string.go @@ -0,0 +1,26 @@ +// Code generated by "stringer -type=ErrorType"; DO NOT EDIT. + +package zanzibar + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[TChannelError-1] + _ = x[ClientException-2] + _ = x[BadResponse-3] +} + +const _ErrorType_name = "TChannelErrorClientExceptionBadResponse" + +var _ErrorType_index = [...]uint8{0, 13, 28, 39} + +func (i ErrorType) String() string { + i -= 1 + if i < 0 || i >= ErrorType(len(_ErrorType_index)-1) { + return "ErrorType(" + strconv.FormatInt(int64(i+1), 10) + ")" + } + return _ErrorType_name[_ErrorType_index[i]:_ErrorType_index[i+1]] +} From 61a28099e0c820510aca0b7a0f2e9efa70545dc5 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 26 Jun 2023 17:48:42 +0530 Subject: [PATCH 02/86] add ut --- runtime/error_builder_test.go | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 runtime/error_builder_test.go diff --git a/runtime/error_builder_test.go b/runtime/error_builder_test.go new file mode 100644 index 000000000..5f3c1cbe1 --- /dev/null +++ b/runtime/error_builder_test.go @@ -0,0 +1,51 @@ +package zanzibar_test + +import ( + "errors" + "go.uber.org/zap" + "strconv" + "testing" + + "github.com/stretchr/testify/assert" + zanzibar "github.com/uber/zanzibar/runtime" +) + +func TestErrorBuilder(t *testing.T) { + eb := zanzibar.NewErrorBuilder("endpoint", "foo") + err := errors.New("test error") + zerr := eb.Error(err, zanzibar.TChannelError) + + assert.Equal(t, "endpoint::foo", zerr.ErrorLocation()) + assert.Equal(t, "TChannelError", zerr.ErrorType().String()) + assert.True(t, errors.Is(zerr, err)) +} + +func TestErrorBuilderLogFields(t *testing.T) { + eb := zanzibar.NewErrorBuilder("client", "bar") + testErr := errors.New("test error") + table := []struct { + err error + wantErrLocation string + wantErrType string + }{ + { + err: eb.Error(testErr, zanzibar.ClientException), + wantErrLocation: "client::bar", + wantErrType: "ClientException", + }, + { + err: testErr, + wantErrLocation: "~client::bar", + wantErrType: "ErrorType(0)", + }, + } + for i, tt := range table { + t.Run("test"+strconv.Itoa(i), func(t *testing.T) { + logFieldErrLocation := eb.LogFieldErrorLocation(tt.err) + logFieldErrType := eb.LogFieldErrorType(tt.err) + + assert.Equal(t, zap.String("errorLocation", tt.wantErrLocation), logFieldErrLocation) + assert.Equal(t, zap.String("errorType", tt.wantErrType), logFieldErrType) + }) + } +} From 7e54e5090767eebd41594fb21660e6d955c5b3ca Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 26 Jun 2023 18:00:10 +0530 Subject: [PATCH 03/86] add license --- runtime/error.go | 20 ++++++++++++++++++++ runtime/error_builder.go | 20 ++++++++++++++++++++ runtime/error_builder_test.go | 22 +++++++++++++++++++++- runtime/errortype_string.go | 20 ++++++++++++++++++++ 4 files changed, 81 insertions(+), 1 deletion(-) diff --git a/runtime/error.go b/runtime/error.go index 3b7e06493..919733129 100644 --- a/runtime/error.go +++ b/runtime/error.go @@ -1,3 +1,23 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zanzibar // ErrorType is used for error grouping. diff --git a/runtime/error_builder.go b/runtime/error_builder.go index cde0a6a3b..1cb0db7ac 100644 --- a/runtime/error_builder.go +++ b/runtime/error_builder.go @@ -1,3 +1,23 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zanzibar import "go.uber.org/zap" diff --git a/runtime/error_builder_test.go b/runtime/error_builder_test.go index 5f3c1cbe1..1954f5588 100644 --- a/runtime/error_builder_test.go +++ b/runtime/error_builder_test.go @@ -1,13 +1,33 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zanzibar_test import ( "errors" - "go.uber.org/zap" "strconv" "testing" "github.com/stretchr/testify/assert" zanzibar "github.com/uber/zanzibar/runtime" + "go.uber.org/zap" ) func TestErrorBuilder(t *testing.T) { diff --git a/runtime/errortype_string.go b/runtime/errortype_string.go index bf30e8d28..a27ff28db 100644 --- a/runtime/errortype_string.go +++ b/runtime/errortype_string.go @@ -1,3 +1,23 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + // Code generated by "stringer -type=ErrorType"; DO NOT EDIT. package zanzibar From 23455663f1c5420c56864c77d8470e28a4f5d6c2 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Tue, 27 Jun 2023 10:17:56 +0530 Subject: [PATCH 04/86] codegen --- codegen/template_bundle/template_files.go | 74 +- codegen/templates/endpoint.tmpl | 5 +- codegen/templates/tchannel_client.tmpl | 10 +- codegen/templates/workflow.tmpl | 31 +- config/production.gen.go | 3 +- .../example-gateway/build/clients/baz/baz.go | 190 +- .../build/clients/corge/corge.go | 8 +- .../bar/bar_bar_method_argnotstruct.go | 3 + .../bar/bar_bar_method_argwithheaders.go | 4 + .../bar_bar_method_argwithmanyqueryparams.go | 4 + ...ar_bar_method_argwithneardupqueryparams.go | 4 + ...bar_bar_method_argwithnestedqueryparams.go | 4 + .../bar/bar_bar_method_argwithparams.go | 4 + ..._method_argwithparamsandduplicatefields.go | 4 + .../bar/bar_bar_method_argwithqueryheader.go | 4 + .../bar/bar_bar_method_argwithqueryparams.go | 4 + .../bar/bar_bar_method_deletewithbody.go | 4 + .../bar/bar_bar_method_helloworld.go | 3 + .../bar/bar_bar_method_listandenum.go | 3 + .../bar/bar_bar_method_missingarg.go | 3 + .../endpoints/bar/bar_bar_method_norequest.go | 3 + .../endpoints/bar/bar_bar_method_normal.go | 3 + .../bar/bar_bar_method_toomanyargs.go | 3 + .../workflow/bar_bar_method_argnotstruct.go | 15 +- .../workflow/bar_bar_method_argwithheaders.go | 11 +- .../bar_bar_method_argwithmanyqueryparams.go | 11 +- ...ar_bar_method_argwithneardupqueryparams.go | 11 +- ...bar_bar_method_argwithnestedqueryparams.go | 11 +- .../workflow/bar_bar_method_argwithparams.go | 11 +- ..._method_argwithparamsandduplicatefields.go | 11 +- .../bar_bar_method_argwithqueryheader.go | 11 +- .../bar_bar_method_argwithqueryparams.go | 11 +- .../workflow/bar_bar_method_deletewithbody.go | 11 +- .../bar/workflow/bar_bar_method_helloworld.go | 19 +- .../workflow/bar_bar_method_listandenum.go | 15 +- .../bar/workflow/bar_bar_method_missingarg.go | 15 +- .../bar/workflow/bar_bar_method_norequest.go | 15 +- .../bar/workflow/bar_bar_method_normal.go | 15 +- .../workflow/bar_bar_method_toomanyargs.go | 19 +- .../baz/baz_simpleservice_method_call.go | 3 + .../baz/baz_simpleservice_method_compare.go | 3 + .../baz_simpleservice_method_getprofile.go | 3 + .../baz_simpleservice_method_headerschema.go | 3 + .../baz/baz_simpleservice_method_ping.go | 4 + .../baz/baz_simpleservice_method_sillynoop.go | 3 + .../baz/baz_simpleservice_method_trans.go | 3 + .../baz_simpleservice_method_transheaders.go | 3 + ..._simpleservice_method_transheadersnoreq.go | 3 + ...z_simpleservice_method_transheaderstype.go | 3 + .../workflow/baz_simpleservice_method_call.go | 15 +- .../baz_simpleservice_method_compare.go | 19 +- .../baz_simpleservice_method_getprofile.go | 15 +- .../baz_simpleservice_method_headerschema.go | 19 +- .../workflow/baz_simpleservice_method_ping.go | 11 +- .../baz_simpleservice_method_sillynoop.go | 19 +- .../baz_simpleservice_method_trans.go | 19 +- .../baz_simpleservice_method_transheaders.go | 19 +- ..._simpleservice_method_transheadersnoreq.go | 15 +- ...z_simpleservice_method_transheaderstype.go | 19 +- .../clientless_clientless_method_beta.go | 4 + ...entless_method_clientlessargwithheaders.go | 4 + ...lientless_method_emptyclientlessrequest.go | 4 + .../contacts_contacts_method_savecontacts.go | 3 + ...oglenow_googlenow_method_addcredentials.go | 4 + ...lenow_googlenow_method_checkcredentials.go | 4 + ...oglenow_googlenow_method_addcredentials.go | 11 +- ...lenow_googlenow_method_checkcredentials.go | 11 +- .../multi/multi_serviceafront_method_hello.go | 4 + .../multi/multi_servicebfront_method_hello.go | 4 + .../multi_serviceafront_method_hello.go | 11 +- .../multi_servicebfront_method_hello.go | 11 +- .../panic/panic_servicecfront_method_hello.go | 4 + .../baz_simpleservice_method_call_tchannel.go | 8 +- ...mpleservice_method_anothercall_tchannel.go | 8 +- ...hexceptions_withexceptions_method_func1.go | 3 + ...hexceptions_withexceptions_method_func1.go | 19 +- .../clients-idl/clients/bar/bar/bar.go | 2738 ++++++++--------- .../clients-idl/clients/baz/base/base.go | 224 +- .../clients-idl/clients/baz/baz/baz.go | 2250 +++++++------- .../clients/contacts/contacts/contacts.go | 354 +-- .../clients-idl/clients/corge/corge/corge.go | 386 +-- .../clients-idl/clients/echo/echo.pb.yarpc.go | 16 +- .../clients-idl/clients/foo/base/base/base.go | 32 +- .../clients-idl/clients/foo/foo/foo.go | 96 +- .../clients/googlenow/googlenow/googlenow.go | 130 +- .../clients-idl/clients/multi/multi/multi.go | 194 +- .../withexceptions/withexceptions.go | 160 +- .../endpoints/app/demo/endpoints/abc/abc.go | 64 +- .../endpoints-idl/endpoints/bar/bar/bar.go | 1426 ++++----- .../endpoints-idl/endpoints/baz/baz/baz.go | 1314 ++++---- .../endpoints/bounce/bounce/bounce.go | 64 +- .../clientless/clientless/clientless.go | 258 +- .../endpoints/contacts/contacts/contacts.go | 354 +-- .../endpoints/foo/base/base/base.go | 32 +- .../endpoints-idl/endpoints/foo/foo/foo.go | 96 +- .../googlenow/googlenow/googlenow.go | 130 +- .../endpoints/models/meta/meta.go | 224 +- .../endpoints/multi/multi/multi.go | 194 +- .../endpoints/tchannel/baz/baz/baz.go | 514 ++-- .../endpoints/tchannel/echo/echo/echo.go | 64 +- .../endpoints/tchannel/quux/quux/quux.go | 64 +- .../withexceptions/withexceptions.go | 160 +- .../build/gen-code/clients/bar/bar/bar.go | 2642 ++++++++-------- .../gen-code/clients/foo/base/base/base.go | 32 +- .../build/gen-code/clients/foo/foo/foo.go | 96 +- .../endpoints/bounce/bounce/bounce.go | 64 +- .../endpoints/tchannel/echo/echo/echo.go | 64 +- .../proto-gen/clients/echo/echo.pb.yarpc.go | 32 +- .../clients/mirror/mirror.pb.yarpc.go | 32 +- runtime/error.go | 16 +- runtime/error_builder.go | 65 +- runtime/error_builder_test.go | 42 +- 112 files changed, 7950 insertions(+), 7581 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 25967bf82..15a922e60 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -641,7 +641,10 @@ func (h *{{$handlerName}}) HandleRequest( } if err != nil { - {{- if eq (len .Exceptions) 0 -}} + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + {{if eq (len .Exceptions) 0}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} @@ -702,7 +705,7 @@ func endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "endpoint.tmpl", size: 7963, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "endpoint.tmpl", size: 8030, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3788,6 +3791,7 @@ func {{$exportName}}(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -3888,6 +3892,7 @@ type {{$clientName}} struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } {{range $svc := .Services}} @@ -3947,12 +3952,14 @@ type {{$clientName}} struct { err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { {{range .Exceptions -}} case result.{{title .Name}} != nil: - err = result.{{title .Name}} + err = c.errorBuilder.Error(result.{{title .Name}}, zanzibar.ClientException) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -3961,6 +3968,7 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -3977,6 +3985,7 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -3997,7 +4006,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 15884, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16278, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4285,9 +4294,9 @@ func (h *{{$handlerName}}) Handle( {{$method := .Name -}} {{range .Exceptions -}} case *{{.Type}}: - ctxWithError := zanzibar.WithScopeTags(ctx, map[string]string{ + ctxWithError := zanzibar.WithScopeTagsDefault(ctx, map[string]string{ "app-error": "{{.Type}}", - }) + }, h.Deps.Default.ContextMetrics.Scope()) h.Deps.Default.ContextMetrics.IncCounter(ctxWithError, zanzibar.MetricEndpointAppErrors, 1) if v == nil { ctx = h.Deps.Default.ContextLogger.ErrorZ( @@ -4303,9 +4312,9 @@ func (h *{{$handlerName}}) Handle( res.{{title .Name}} = v {{end -}} default: - ctxWithError := zanzibar.WithScopeTags(ctx, map[string]string{ + ctxWithError := zanzibar.WithScopeTagsDefault(ctx, map[string]string{ "app-error": "unknown", - }) + }, h.Deps.Default.ContextMetrics.Scope()) h.Deps.Default.ContextMetrics.IncCounter(ctxWithError, zanzibar.MetricEndpointAppErrors, 1) ctx = h.Deps.Default.ContextLogger.ErrorZ(ctx, "Endpoint failure: handler returned error", zap.Error(err)) return ctx, false, nil, resHeaders, errors.Wrapf( @@ -4410,7 +4419,7 @@ func tchannel_endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9278, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9370, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4512,6 +4521,7 @@ func New{{$workflowInterface}}(deps *module.Dependencies) {{$workflowInterface}} Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -4521,6 +4531,7 @@ type {{$workflowStruct}} struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -4644,34 +4655,31 @@ func (w {{$workflowStruct}}) Handle( {{- $responseType := .ResponseType }} if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { {{range $idx, $cException := $clientExceptions}} case *{{$cException.Type}}: - serverErr := convert{{$methodName}}{{title $cException.Name}}( + err = convert{{$methodName}}{{title $cException.Name}}( errValue, ) - {{if eq $responseType ""}} - return ctx, nil, serverErr - {{else if eq $responseType "string" }} - return ctx, "", nil, serverErr - {{else}} - return ctx, nil, nil, serverErr - {{end}} {{end}} default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "{{$clientName}}"), ) - - {{if eq $responseType ""}} - return ctx, nil, err - {{else if eq $responseType "string" }} - return ctx, "", nil, err - {{else}} - return ctx, nil, nil, err - {{end}} } + err = w.errorBuilder.Rebuild(zErr, err) + {{if eq $responseType ""}} + return ctx, nil, err + {{else if eq $responseType "string" }} + return ctx, "", nil, err + {{else}} + return ctx, nil, nil, err + {{end}} } // Filter and map response headers from client to server response. @@ -4746,7 +4754,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10580, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10619, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -5014,13 +5022,11 @@ var _bindata = map[string]func() (*asset, error){ // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: -// -// data/ -// foo.txt -// img/ -// a.png -// b.png -// +// data/ +// foo.txt +// img/ +// a.png +// b.png // then AssetDir("data") would return []string{"foo.txt", "img"} // AssetDir("data/img") would return []string{"a.png", "b.png"} // AssetDir("foo.txt") and AssetDir("notexist") would return an error diff --git a/codegen/templates/endpoint.tmpl b/codegen/templates/endpoint.tmpl index 6ec0a9262..aaa7f97fa 100644 --- a/codegen/templates/endpoint.tmpl +++ b/codegen/templates/endpoint.tmpl @@ -217,7 +217,10 @@ func (h *{{$handlerName}}) HandleRequest( } if err != nil { - {{- if eq (len .Exceptions) 0 -}} + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + {{if eq (len .Exceptions) 0}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index 2780abbf7..7b2bc086f 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -225,6 +225,7 @@ func {{$exportName}}(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -325,6 +326,7 @@ type {{$clientName}} struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } {{range $svc := .Services}} @@ -384,12 +386,14 @@ type {{$clientName}} struct { err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { {{range .Exceptions -}} case result.{{title .Name}} != nil: - err = result.{{title .Name}} + err = c.errorBuilder.Error(result.{{title .Name}}, zanzibar.ClientException) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -398,6 +402,7 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -414,6 +419,7 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err diff --git a/codegen/templates/workflow.tmpl b/codegen/templates/workflow.tmpl index d55406872..8f31babbc 100644 --- a/codegen/templates/workflow.tmpl +++ b/codegen/templates/workflow.tmpl @@ -95,6 +95,7 @@ func New{{$workflowInterface}}(deps *module.Dependencies) {{$workflowInterface}} Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -104,6 +105,7 @@ type {{$workflowStruct}} struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -227,34 +229,31 @@ func (w {{$workflowStruct}}) Handle( {{- $responseType := .ResponseType }} if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { {{range $idx, $cException := $clientExceptions}} case *{{$cException.Type}}: - serverErr := convert{{$methodName}}{{title $cException.Name}}( + err = convert{{$methodName}}{{title $cException.Name}}( errValue, ) - {{if eq $responseType ""}} - return ctx, nil, serverErr - {{else if eq $responseType "string" }} - return ctx, "", nil, serverErr - {{else}} - return ctx, nil, nil, serverErr - {{end}} {{end}} default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "{{$clientName}}"), ) - - {{if eq $responseType ""}} - return ctx, nil, err - {{else if eq $responseType "string" }} - return ctx, "", nil, err - {{else}} - return ctx, nil, nil, err - {{end}} } + err = w.errorBuilder.Rebuild(zErr, err) + {{if eq $responseType ""}} + return ctx, nil, err + {{else if eq $responseType "string" }} + return ctx, "", nil, err + {{else}} + return ctx, nil, nil, err + {{end}} } // Filter and map response headers from client to server response. diff --git a/config/production.gen.go b/config/production.gen.go index e9696c895..eab9bb889 100644 --- a/config/production.gen.go +++ b/config/production.gen.go @@ -82,6 +82,7 @@ metrics.runtime.enableGCMetrics: true metrics.runtime.enableMemMetrics: true metrics.type: m3 service.env.config: {} +logger.level: warn subLoggerLevel.http: warn subLoggerLevel.jaeger: warn subLoggerLevel.tchannel: warn @@ -100,7 +101,7 @@ func productionYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "production.yaml", size: 810, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "production.yaml", size: 829, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/baz/baz.go b/examples/example-gateway/build/clients/baz/baz.go index 326a46086..5e68ff3e2 100644 --- a/examples/example-gateway/build/clients/baz/baz.go +++ b/examples/example-gateway/build/clients/baz/baz.go @@ -415,6 +415,7 @@ func NewClient(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("client", "baz"), } } @@ -515,6 +516,7 @@ type bazClient struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // EchoBinary is a client RPC call for method "SecondService::echoBinary" @@ -562,7 +564,9 @@ func (c *bazClient) EchoBinary( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -570,6 +574,7 @@ func (c *bazClient) EchoBinary( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBinary") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -579,6 +584,7 @@ func (c *bazClient) EchoBinary( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBinary_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -629,7 +635,9 @@ func (c *bazClient) EchoBool( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -637,6 +645,7 @@ func (c *bazClient) EchoBool( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBool") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -646,6 +655,7 @@ func (c *bazClient) EchoBool( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBool_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -696,7 +706,9 @@ func (c *bazClient) EchoDouble( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -704,6 +716,7 @@ func (c *bazClient) EchoDouble( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoDouble") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -713,6 +726,7 @@ func (c *bazClient) EchoDouble( resp, err = clientsIDlClientsBazBaz.SecondService_EchoDouble_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -763,7 +777,9 @@ func (c *bazClient) EchoEnum( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -771,6 +787,7 @@ func (c *bazClient) EchoEnum( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoEnum") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -780,6 +797,7 @@ func (c *bazClient) EchoEnum( resp, err = clientsIDlClientsBazBaz.SecondService_EchoEnum_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -830,7 +848,9 @@ func (c *bazClient) EchoI16( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -838,6 +858,7 @@ func (c *bazClient) EchoI16( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI16") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -847,6 +868,7 @@ func (c *bazClient) EchoI16( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI16_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -897,7 +919,9 @@ func (c *bazClient) EchoI32( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -905,6 +929,7 @@ func (c *bazClient) EchoI32( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI32") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -914,6 +939,7 @@ func (c *bazClient) EchoI32( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI32_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -964,7 +990,9 @@ func (c *bazClient) EchoI64( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -972,6 +1000,7 @@ func (c *bazClient) EchoI64( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI64") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -981,6 +1010,7 @@ func (c *bazClient) EchoI64( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI64_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1031,7 +1061,9 @@ func (c *bazClient) EchoI8( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1039,6 +1071,7 @@ func (c *bazClient) EchoI8( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI8") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1048,6 +1081,7 @@ func (c *bazClient) EchoI8( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI8_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1098,7 +1132,9 @@ func (c *bazClient) EchoString( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1106,6 +1142,7 @@ func (c *bazClient) EchoString( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoString") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1115,6 +1152,7 @@ func (c *bazClient) EchoString( resp, err = clientsIDlClientsBazBaz.SecondService_EchoString_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1165,7 +1203,9 @@ func (c *bazClient) EchoStringList( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1173,6 +1213,7 @@ func (c *bazClient) EchoStringList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringList") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1182,6 +1223,7 @@ func (c *bazClient) EchoStringList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringList_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1232,7 +1274,9 @@ func (c *bazClient) EchoStringMap( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1240,6 +1284,7 @@ func (c *bazClient) EchoStringMap( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringMap") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1249,6 +1294,7 @@ func (c *bazClient) EchoStringMap( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringMap_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1299,7 +1345,9 @@ func (c *bazClient) EchoStringSet( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1307,6 +1355,7 @@ func (c *bazClient) EchoStringSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringSet") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1316,6 +1365,7 @@ func (c *bazClient) EchoStringSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringSet_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1366,7 +1416,9 @@ func (c *bazClient) EchoStructList( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1374,6 +1426,7 @@ func (c *bazClient) EchoStructList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructList") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1383,6 +1436,7 @@ func (c *bazClient) EchoStructList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructList_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1433,7 +1487,9 @@ func (c *bazClient) EchoStructSet( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1441,6 +1497,7 @@ func (c *bazClient) EchoStructSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructSet") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1450,6 +1507,7 @@ func (c *bazClient) EchoStructSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructSet_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1500,7 +1558,9 @@ func (c *bazClient) EchoTypedef( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1508,6 +1568,7 @@ func (c *bazClient) EchoTypedef( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoTypedef") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1517,6 +1578,7 @@ func (c *bazClient) EchoTypedef( resp, err = clientsIDlClientsBazBaz.SecondService_EchoTypedef_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1566,13 +1628,16 @@ func (c *bazClient) Call( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) default: err = errors.New("bazClient received no result or unknown exception for Call") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1628,18 +1693,21 @@ func (c *bazClient) Compare( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Compare. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for Compare") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1649,6 +1717,7 @@ func (c *bazClient) Compare( resp, err = clientsIDlClientsBazBaz.SimpleService_Compare_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1699,16 +1768,19 @@ func (c *bazClient) GetProfile( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for GetProfile") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1718,6 +1790,7 @@ func (c *bazClient) GetProfile( resp, err = clientsIDlClientsBazBaz.SimpleService_GetProfile_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1768,18 +1841,21 @@ func (c *bazClient) HeaderSchema( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for HeaderSchema") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1789,6 +1865,7 @@ func (c *bazClient) HeaderSchema( resp, err = clientsIDlClientsBazBaz.SimpleService_HeaderSchema_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1839,7 +1916,9 @@ func (c *bazClient) Ping( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1847,6 +1926,7 @@ func (c *bazClient) Ping( success = true default: err = errors.New("bazClient received no result or unknown exception for Ping") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1856,6 +1936,7 @@ func (c *bazClient) Ping( resp, err = clientsIDlClientsBazBaz.SimpleService_Ping_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1905,15 +1986,18 @@ func (c *bazClient) DeliberateDiffNoop( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.ServerErr != nil: - err = result.ServerErr + err = c.errorBuilder.Error(result.ServerErr, zanzibar.ClientException) default: err = errors.New("bazClient received no result or unknown exception for SillyNoop") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1968,11 +2052,14 @@ func (c *bazClient) TestUUID( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { default: err = errors.New("bazClient received no result or unknown exception for TestUuid") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2028,18 +2115,21 @@ func (c *bazClient) Trans( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Trans. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for Trans") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2049,6 +2139,7 @@ func (c *bazClient) Trans( resp, err = clientsIDlClientsBazBaz.SimpleService_Trans_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2099,18 +2190,21 @@ func (c *bazClient) TransHeaders( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeaders") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2120,6 +2214,7 @@ func (c *bazClient) TransHeaders( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeaders_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2170,16 +2265,19 @@ func (c *bazClient) TransHeadersNoReq( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersNoReq") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2189,6 +2287,7 @@ func (c *bazClient) TransHeadersNoReq( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersNoReq_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2239,18 +2338,21 @@ func (c *bazClient) TransHeadersType( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersType") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2260,6 +2362,7 @@ func (c *bazClient) TransHeadersType( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersType_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2309,11 +2412,14 @@ func (c *bazClient) URLTest( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { default: err = errors.New("bazClient received no result or unknown exception for UrlTest") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { diff --git a/examples/example-gateway/build/clients/corge/corge.go b/examples/example-gateway/build/clients/corge/corge.go index 506c55f94..36e82d21e 100644 --- a/examples/example-gateway/build/clients/corge/corge.go +++ b/examples/example-gateway/build/clients/corge/corge.go @@ -208,6 +208,7 @@ func NewClient(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("client", "corge"), } } @@ -308,6 +309,7 @@ type corgeClient struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // EchoString is a client RPC call for method "Corge::echoString" @@ -355,7 +357,9 @@ func (c *corgeClient) EchoString( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -363,6 +367,7 @@ func (c *corgeClient) EchoString( success = true default: err = errors.New("corgeClient received no result or unknown exception for EchoString") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -372,6 +377,7 @@ func (c *corgeClient) EchoString( resp, err = clientsIDlClientsCorgeCorge.Corge_EchoString_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go index 855c09001..8cdf41e5b 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go @@ -142,6 +142,9 @@ func (h *BarArgNotStructHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go index d273b2656..dd1cc0868 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go @@ -173,6 +173,10 @@ func (h *BarArgWithHeadersHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go index e94ce9494..eb98461a2 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go @@ -476,6 +476,10 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go index 584383952..e0d99324d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go @@ -199,6 +199,10 @@ func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go index d3fc928a5..fac805b6d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go @@ -255,6 +255,10 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go index 0995c7f78..bba729ca8 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go @@ -170,6 +170,10 @@ func (h *BarArgWithParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go index 40770cde2..c0aacea40 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go @@ -166,6 +166,10 @@ func (h *BarArgWithParamsAndDuplicateFieldsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go index 24a31a683..cc14126f1 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go @@ -167,6 +167,10 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go index 2776ae988..7508f0b51 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go @@ -200,6 +200,10 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go index e775dc4f6..8e4daed0d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go @@ -142,6 +142,10 @@ func (h *BarDeleteWithBodyHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go index 62fe2c6ed..630cb8a5c 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go @@ -136,6 +136,9 @@ func (h *BarHelloWorldHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go index d1afeb485..84f8eaa17 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go @@ -206,6 +206,9 @@ func (h *BarListAndEnumHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go index fc72eac8f..b0481eb7d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go @@ -135,6 +135,9 @@ func (h *BarMissingArgHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go index 66b993bb8..21f06d638 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go @@ -135,6 +135,9 @@ func (h *BarNoRequestHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go index 619fccae3..a66bd2321 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go @@ -171,6 +171,9 @@ func (h *BarNormalHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go index 34eff269c..04694bfa2 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go @@ -165,6 +165,9 @@ func (h *BarTooManyArgsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go index cfa08619c..a8e4d5752 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go @@ -63,6 +63,7 @@ func NewBarArgNotStructWorkflow(deps *module.Dependencies) BarArgNotStructWorkfl Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgNotStructWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,24 +131,27 @@ func (w barArgNotStructWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertArgNotStructBarException( + err = convertArgNotStructBarException( errValue, ) - return ctx, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go index 179985b5e..ece5587aa 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go @@ -63,6 +63,7 @@ func NewBarArgWithHeadersWorkflow(deps *module.Dependencies) BarArgWithHeadersWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithHeadersWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -133,6 +135,10 @@ func (w barArgWithHeadersWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -140,10 +146,11 @@ func (w barArgWithHeadersWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go index ce325271e..12b9ea68b 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go @@ -63,6 +63,7 @@ func NewBarArgWithManyQueryParamsWorkflow(deps *module.Dependencies) BarArgWithM Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithManyQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,6 +131,10 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -136,10 +142,11 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go index b363c6d7f..ff965fd97 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go @@ -63,6 +63,7 @@ func NewBarArgWithNearDupQueryParamsWorkflow(deps *module.Dependencies) BarArgWi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithNearDupQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,6 +131,10 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -136,10 +142,11 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go index f668b410b..a1c68a6df 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go @@ -63,6 +63,7 @@ func NewBarArgWithNestedQueryParamsWorkflow(deps *module.Dependencies) BarArgWit Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithNestedQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,6 +131,10 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -136,10 +142,11 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go index f086d9dab..c2831d4b1 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go @@ -63,6 +63,7 @@ func NewBarArgWithParamsWorkflow(deps *module.Dependencies) BarArgWithParamsWork Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,6 +131,10 @@ func (w barArgWithParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -136,10 +142,11 @@ func (w barArgWithParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go index 1bef9d948..ae79c955b 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go @@ -63,6 +63,7 @@ func NewBarArgWithParamsAndDuplicateFieldsWorkflow(deps *module.Dependencies) Ba Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithParamsAndDuplicateFieldsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,6 +131,10 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -136,10 +142,11 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go index 8e0bd366e..41e9fe4c4 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go @@ -63,6 +63,7 @@ func NewBarArgWithQueryHeaderWorkflow(deps *module.Dependencies) BarArgWithQuery Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithQueryHeaderWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,6 +131,10 @@ func (w barArgWithQueryHeaderWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -136,10 +142,11 @@ func (w barArgWithQueryHeaderWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go index f86447d02..07472c5d4 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go @@ -63,6 +63,7 @@ func NewBarArgWithQueryParamsWorkflow(deps *module.Dependencies) BarArgWithQuery Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -137,6 +139,10 @@ func (w barArgWithQueryParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -144,10 +150,11 @@ func (w barArgWithQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go index b48bc18b9..07bac7604 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go @@ -63,6 +63,7 @@ func NewBarDeleteWithBodyWorkflow(deps *module.Dependencies) BarDeleteWithBodyWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barDeleteWithBodyWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,6 +131,10 @@ func (w barDeleteWithBodyWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -136,10 +142,11 @@ func (w barDeleteWithBodyWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go index b359d7527..922e12225 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go @@ -62,6 +62,7 @@ func NewBarHelloWorldWorkflow(deps *module.Dependencies) BarHelloWorldWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -71,6 +72,7 @@ type barHelloWorldWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -126,31 +128,32 @@ func (w barHelloWorldWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertHelloWorldBarException( + err = convertHelloWorldBarException( errValue, ) - return ctx, "", nil, serverErr - case *clientsIDlClientsBarBar.SeeOthersRedirection: - serverErr := convertHelloWorldSeeOthersRedirection( + err = convertHelloWorldSeeOthersRedirection( errValue, ) - return ctx, "", nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err + return ctx, "", nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go index be0005302..d89ef3445 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go @@ -63,6 +63,7 @@ func NewBarListAndEnumWorkflow(deps *module.Dependencies) BarListAndEnumWorkflow Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barListAndEnumWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,24 +131,27 @@ func (w barListAndEnumWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertListAndEnumBarException( + err = convertListAndEnumBarException( errValue, ) - return ctx, "", nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err + return ctx, "", nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go index 4f510eb6b..c37017c24 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go @@ -62,6 +62,7 @@ func NewBarMissingArgWorkflow(deps *module.Dependencies) BarMissingArgWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -71,6 +72,7 @@ type barMissingArgWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -126,24 +128,27 @@ func (w barMissingArgWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertMissingArgBarException( + err = convertMissingArgBarException( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go index c9eef71f4..ff18943dc 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go @@ -62,6 +62,7 @@ func NewBarNoRequestWorkflow(deps *module.Dependencies) BarNoRequestWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -71,6 +72,7 @@ type barNoRequestWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -126,24 +128,27 @@ func (w barNoRequestWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertNoRequestBarException( + err = convertNoRequestBarException( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go index e2c1a17c1..6555ed961 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go @@ -63,6 +63,7 @@ func NewBarNormalWorkflow(deps *module.Dependencies) BarNormalWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barNormalWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,24 +131,27 @@ func (w barNormalWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertNormalBarException( + err = convertNormalBarException( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go index 7a5299294..85228236f 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go @@ -66,6 +66,7 @@ func NewBarTooManyArgsWorkflow(deps *module.Dependencies) BarTooManyArgsWorkflow Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -75,6 +76,7 @@ type barTooManyArgsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -140,31 +142,32 @@ func (w barTooManyArgsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertTooManyArgsBarException( + err = convertTooManyArgsBarException( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsFooFoo.FooException: - serverErr := convertTooManyArgsFooException( + err = convertTooManyArgsFooException( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go index 3d0e9cdcb..42ec6b084 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go @@ -157,6 +157,9 @@ func (h *SimpleServiceCallHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go index db84a6945..853f4f76e 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go @@ -164,6 +164,9 @@ func (h *SimpleServiceCompareHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go index c78889b4b..1539f345e 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go @@ -164,6 +164,9 @@ func (h *SimpleServiceGetProfileHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go index f1970b89d..2eff4135e 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go @@ -167,6 +167,9 @@ func (h *SimpleServiceHeaderSchemaHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go index 7e2d511d9..410cf0d7d 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go @@ -134,6 +134,10 @@ func (h *SimpleServicePingHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go index 1e6608132..8038f07f1 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go @@ -135,6 +135,9 @@ func (h *SimpleServiceSillyNoopHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go index 8fb8f2ffc..cb6e0f008 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go @@ -164,6 +164,9 @@ func (h *SimpleServiceTransHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go index c9ebb54e6..6df2f9dbc 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go @@ -164,6 +164,9 @@ func (h *SimpleServiceTransHeadersHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go index 8fcf59ddd..741177811 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go @@ -139,6 +139,9 @@ func (h *SimpleServiceTransHeadersNoReqHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go index 6bf50bff2..8f8ab06ff 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go @@ -164,6 +164,9 @@ func (h *SimpleServiceTransHeadersTypeHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go index 2a285c787..eb400aaef 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go @@ -63,6 +63,7 @@ func NewSimpleServiceCallWorkflow(deps *module.Dependencies) SimpleServiceCallWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,6 +73,7 @@ type simpleServiceCallWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -137,24 +139,27 @@ func (w simpleServiceCallWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertCallAuthErr( + err = convertCallAuthErr( errValue, ) - return ctx, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go index 06494b0a5..6af1e8ee6 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go @@ -64,6 +64,7 @@ func NewSimpleServiceCompareWorkflow(deps *module.Dependencies) SimpleServiceCom Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceCompareWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,31 +132,32 @@ func (w simpleServiceCompareWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertCompareAuthErr( + err = convertCompareAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertCompareOtherAuthErr( + err = convertCompareOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go index 8be616027..6abb63f57 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go @@ -63,6 +63,7 @@ func NewSimpleServiceGetProfileWorkflow(deps *module.Dependencies) SimpleService Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,6 +73,7 @@ type simpleServiceGetProfileWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,24 +131,27 @@ func (w simpleServiceGetProfileWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertGetProfileAuthErr( + err = convertGetProfileAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go index 5c09de64c..3c952fb66 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go @@ -63,6 +63,7 @@ func NewSimpleServiceHeaderSchemaWorkflow(deps *module.Dependencies) SimpleServi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,6 +73,7 @@ type simpleServiceHeaderSchemaWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -145,31 +147,32 @@ func (w simpleServiceHeaderSchemaWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertHeaderSchemaAuthErr( + err = convertHeaderSchemaAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertHeaderSchemaOtherAuthErr( + err = convertHeaderSchemaOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go index 430a524f1..96d243da0 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go @@ -62,6 +62,7 @@ func NewSimpleServicePingWorkflow(deps *module.Dependencies) SimpleServicePingWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -71,6 +72,7 @@ type simpleServicePingWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -126,6 +128,10 @@ func (w simpleServicePingWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -133,10 +139,11 @@ func (w simpleServicePingWorkflow) Handle( zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go index 0ee95505f..196b13436 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go @@ -63,6 +63,7 @@ func NewSimpleServiceSillyNoopWorkflow(deps *module.Dependencies) SimpleServiceS Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,6 +73,7 @@ type simpleServiceSillyNoopWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -125,31 +127,32 @@ func (w simpleServiceSillyNoopWorkflow) Handle( ctx, _, err := w.Clients.Baz.DeliberateDiffNoop(ctx, clientHeaders, &timeoutAndRetryConfig) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertSillyNoopAuthErr( + err = convertSillyNoopAuthErr( errValue, ) - return ctx, nil, serverErr - case *clientsIDlClientsBazBase.ServerErr: - serverErr := convertSillyNoopServerErr( + err = convertSillyNoopServerErr( errValue, ) - return ctx, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go index cbb2e8b6e..d4dad45d0 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go @@ -64,6 +64,7 @@ func NewSimpleServiceTransWorkflow(deps *module.Dependencies) SimpleServiceTrans Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceTransWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,31 +132,32 @@ func (w simpleServiceTransWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertTransAuthErr( + err = convertTransAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertTransOtherAuthErr( + err = convertTransOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go index b13375bcd..3b8b1684a 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go @@ -64,6 +64,7 @@ func NewSimpleServiceTransHeadersWorkflow(deps *module.Dependencies) SimpleServi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceTransHeadersWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -139,31 +141,32 @@ func (w simpleServiceTransHeadersWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertTransHeadersAuthErr( + err = convertTransHeadersAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertTransHeadersOtherAuthErr( + err = convertTransHeadersOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go index 44f44cbb5..b6de8b6fa 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go @@ -64,6 +64,7 @@ func NewSimpleServiceTransHeadersNoReqWorkflow(deps *module.Dependencies) Simple Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceTransHeadersNoReqWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -141,24 +143,27 @@ func (w simpleServiceTransHeadersNoReqWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertTransHeadersNoReqAuthErr( + err = convertTransHeadersNoReqAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go index b91b235b8..ab10652cf 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go @@ -64,6 +64,7 @@ func NewSimpleServiceTransHeadersTypeWorkflow(deps *module.Dependencies) SimpleS Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceTransHeadersTypeWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -131,31 +133,32 @@ func (w simpleServiceTransHeadersTypeWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertTransHeadersTypeAuthErr( + err = convertTransHeadersTypeAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertTransHeadersTypeOtherAuthErr( + err = convertTransHeadersTypeOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go index a052eafc3..728cb69b5 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go @@ -164,6 +164,10 @@ func (h *ClientlessBetaHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go index f434247d9..b832d5e80 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go @@ -175,6 +175,10 @@ func (h *ClientlessClientlessArgWithHeadersHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go index 63394ef53..fe8c447a9 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go @@ -149,6 +149,10 @@ func (h *ClientlessEmptyclientlessRequestHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go b/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go index 1e140d3ab..3d2b5b181 100644 --- a/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go +++ b/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go @@ -169,6 +169,9 @@ func (h *ContactsSaveContactsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch err.(type) { diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go index 2d79f430e..64c8d4e29 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go @@ -145,6 +145,10 @@ func (h *GoogleNowAddCredentialsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go index 1f22547b0..08022c5e9 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go @@ -138,6 +138,10 @@ func (h *GoogleNowCheckCredentialsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go index 5693bc1f7..aa4b0377b 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go @@ -63,6 +63,7 @@ func NewGoogleNowAddCredentialsWorkflow(deps *module.Dependencies) GoogleNowAddC Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "googlenow"), } } @@ -72,6 +73,7 @@ type googleNowAddCredentialsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -137,6 +139,10 @@ func (w googleNowAddCredentialsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -144,10 +150,11 @@ func (w googleNowAddCredentialsWorkflow) Handle( zap.Error(errValue), zap.String("client", "GoogleNow"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go index 1abc07890..ddd2c4c68 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go @@ -59,6 +59,7 @@ func NewGoogleNowCheckCredentialsWorkflow(deps *module.Dependencies) GoogleNowCh Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "googlenow"), } } @@ -68,6 +69,7 @@ type googleNowCheckCredentialsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,6 +131,10 @@ func (w googleNowCheckCredentialsWorkflow) Handle( ctx, cliRespHeaders, err := w.Clients.GoogleNow.CheckCredentials(ctx, clientHeaders, &timeoutAndRetryConfig) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -136,10 +142,11 @@ func (w googleNowCheckCredentialsWorkflow) Handle( zap.Error(errValue), zap.String("client", "GoogleNow"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go index a9fc12109..8aa679135 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go @@ -135,6 +135,10 @@ func (h *ServiceAFrontHelloHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go index d598e6543..b54960d0c 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go @@ -135,6 +135,10 @@ func (h *ServiceBFrontHelloHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go index cd03aeb62..3c25084b8 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go @@ -59,6 +59,7 @@ func NewServiceAFrontHelloWorkflow(deps *module.Dependencies) ServiceAFrontHello Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "multi"), } } @@ -68,6 +69,7 @@ type serviceAFrontHelloWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -123,6 +125,10 @@ func (w serviceAFrontHelloWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -130,10 +136,11 @@ func (w serviceAFrontHelloWorkflow) Handle( zap.Error(errValue), zap.String("client", "Multi"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err + return ctx, "", nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go index 9dfad7250..d5b257147 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go @@ -59,6 +59,7 @@ func NewServiceBFrontHelloWorkflow(deps *module.Dependencies) ServiceBFrontHello Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "multi"), } } @@ -68,6 +69,7 @@ type serviceBFrontHelloWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -123,6 +125,10 @@ func (w serviceBFrontHelloWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -130,10 +136,11 @@ func (w serviceBFrontHelloWorkflow) Handle( zap.Error(errValue), zap.String("client", "Multi"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err + return ctx, "", nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go index 31f2268e1..c0f36197f 100644 --- a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go @@ -135,6 +135,10 @@ func (h *ServiceCFrontHelloHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_call_tchannel.go b/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_call_tchannel.go index 234168b5b..51c50ddf6 100644 --- a/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_call_tchannel.go +++ b/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_call_tchannel.go @@ -140,9 +140,9 @@ func (h *SimpleServiceCallHandler) Handle( if err != nil { switch v := err.(type) { case *endpointsIDlEndpointsTchannelBazBaz.AuthErr: - ctxWithError := zanzibar.WithScopeTags(ctx, map[string]string{ + ctxWithError := zanzibar.WithScopeTagsDefault(ctx, map[string]string{ "app-error": "endpointsIDlEndpointsTchannelBazBaz.AuthErr", - }) + }, h.Deps.Default.ContextMetrics.Scope()) h.Deps.Default.ContextMetrics.IncCounter(ctxWithError, zanzibar.MetricEndpointAppErrors, 1) if v == nil { ctx = h.Deps.Default.ContextLogger.ErrorZ( @@ -157,9 +157,9 @@ func (h *SimpleServiceCallHandler) Handle( } res.AuthErr = v default: - ctxWithError := zanzibar.WithScopeTags(ctx, map[string]string{ + ctxWithError := zanzibar.WithScopeTagsDefault(ctx, map[string]string{ "app-error": "unknown", - }) + }, h.Deps.Default.ContextMetrics.Scope()) h.Deps.Default.ContextMetrics.IncCounter(ctxWithError, zanzibar.MetricEndpointAppErrors, 1) ctx = h.Deps.Default.ContextLogger.ErrorZ(ctx, "Endpoint failure: handler returned error", zap.Error(err)) return ctx, false, nil, resHeaders, errors.Wrapf( diff --git a/examples/example-gateway/build/endpoints/tchannel/panic/panic_simpleservice_method_anothercall_tchannel.go b/examples/example-gateway/build/endpoints/tchannel/panic/panic_simpleservice_method_anothercall_tchannel.go index ade76f656..6f5bd6954 100644 --- a/examples/example-gateway/build/endpoints/tchannel/panic/panic_simpleservice_method_anothercall_tchannel.go +++ b/examples/example-gateway/build/endpoints/tchannel/panic/panic_simpleservice_method_anothercall_tchannel.go @@ -134,9 +134,9 @@ func (h *SimpleServiceAnotherCallHandler) Handle( if err != nil { switch v := err.(type) { case *endpointsIDlEndpointsTchannelBazBaz.AuthErr: - ctxWithError := zanzibar.WithScopeTags(ctx, map[string]string{ + ctxWithError := zanzibar.WithScopeTagsDefault(ctx, map[string]string{ "app-error": "endpointsIDlEndpointsTchannelBazBaz.AuthErr", - }) + }, h.Deps.Default.ContextMetrics.Scope()) h.Deps.Default.ContextMetrics.IncCounter(ctxWithError, zanzibar.MetricEndpointAppErrors, 1) if v == nil { ctx = h.Deps.Default.ContextLogger.ErrorZ( @@ -151,9 +151,9 @@ func (h *SimpleServiceAnotherCallHandler) Handle( } res.AuthErr = v default: - ctxWithError := zanzibar.WithScopeTags(ctx, map[string]string{ + ctxWithError := zanzibar.WithScopeTagsDefault(ctx, map[string]string{ "app-error": "unknown", - }) + }, h.Deps.Default.ContextMetrics.Scope()) h.Deps.Default.ContextMetrics.IncCounter(ctxWithError, zanzibar.MetricEndpointAppErrors, 1) ctx = h.Deps.Default.ContextLogger.ErrorZ(ctx, "Endpoint failure: handler returned error", zap.Error(err)) return ctx, false, nil, resHeaders, errors.Wrapf( diff --git a/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go index 329ec6c5b..81111d606 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go @@ -135,6 +135,9 @@ func (h *WithExceptionsFunc1Handler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go index 8412ff9d5..f87688d4c 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go @@ -62,6 +62,7 @@ func NewWithExceptionsFunc1Workflow(deps *module.Dependencies) WithExceptionsFun Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "withexceptions"), } } @@ -71,6 +72,7 @@ type withExceptionsFunc1Workflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -126,31 +128,32 @@ func (w withExceptionsFunc1Workflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsWithexceptionsWithexceptions.ExceptionType1: - serverErr := convertFunc1E1( + err = convertFunc1E1( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsWithexceptionsWithexceptions.ExceptionType2: - serverErr := convertFunc1E2( + err = convertFunc1E2( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Withexceptions"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go b/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go index ccad0769e..bda3ba24c 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -781,14 +781,14 @@ type BarRequestRecur struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequestRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -828,16 +828,16 @@ func _BarRequestRecur_Read(w wire.Value) (*BarRequestRecur, error) { // An error is returned if we were unable to build a BarRequestRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequestRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequestRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequestRecur) FromWire(w wire.Value) error { var err error @@ -1132,14 +1132,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1282,16 +1282,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1994,14 +1994,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponseRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2052,16 +2052,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a BarResponseRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponseRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponseRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponseRecur) FromWire(w wire.Value) error { var err error @@ -2358,8 +2358,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -2416,10 +2416,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2436,16 +2436,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -2453,13 +2453,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2557,8 +2557,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -2615,10 +2615,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2635,16 +2635,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -2652,13 +2652,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2797,14 +2797,14 @@ type OptionalParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2832,16 +2832,16 @@ func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OptionalParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OptionalParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OptionalParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OptionalParamsStruct) FromWire(w wire.Value) error { var err error @@ -3017,14 +3017,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3050,16 +3050,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -3224,14 +3224,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -3281,16 +3281,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -3621,14 +3621,14 @@ type QueryParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -3685,16 +3685,16 @@ func (v *QueryParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -4078,14 +4078,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4127,16 +4127,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -4354,14 +4354,14 @@ type SeeOthersRedirection struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -4378,16 +4378,16 @@ func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SeeOthersRedirection struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SeeOthersRedirection -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SeeOthersRedirection +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SeeOthersRedirection) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4818,14 +4818,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4851,16 +4851,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -5129,14 +5129,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5174,16 +5174,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -5396,14 +5396,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5451,16 +5451,16 @@ func _OptionalParamsStruct_Read(w wire.Value) (*OptionalParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5842,14 +5842,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5881,16 +5881,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -6174,14 +6174,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -6464,16 +6464,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8511,14 +8511,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8550,16 +8550,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8767,14 +8767,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -8824,16 +8824,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9271,14 +9271,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9310,16 +9310,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9525,14 +9525,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9581,16 +9581,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9928,14 +9928,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9967,16 +9967,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -10182,14 +10182,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10229,16 +10229,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -10562,14 +10562,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10601,16 +10601,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -10816,14 +10816,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10865,16 +10865,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -11204,14 +11204,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11243,16 +11243,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -11457,14 +11457,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11492,16 +11492,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -11769,14 +11769,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11808,16 +11808,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -12051,14 +12051,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -12125,16 +12125,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12643,14 +12643,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12682,16 +12682,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12896,14 +12896,14 @@ type Bar_DeleteFoo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12929,16 +12929,16 @@ func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Args) FromWire(w wire.Value) error { var err error @@ -13192,14 +13192,14 @@ type Bar_DeleteFoo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13216,16 +13216,16 @@ func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13354,14 +13354,14 @@ type Bar_DeleteWithBody_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13395,16 +13395,16 @@ func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Args) FromWire(w wire.Value) error { var err error @@ -13716,14 +13716,14 @@ type Bar_DeleteWithBody_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13740,16 +13740,16 @@ func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13878,14 +13878,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13919,16 +13919,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -14240,14 +14240,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14264,16 +14264,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14400,14 +14400,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14424,16 +14424,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14666,14 +14666,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14727,16 +14727,16 @@ func _SeeOthersRedirection_Read(w wire.Value) (*SeeOthersRedirection, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -15073,14 +15073,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -15122,16 +15122,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -15537,14 +15537,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15584,16 +15584,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -15861,14 +15861,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15885,16 +15885,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -16115,14 +16115,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16162,16 +16162,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -16435,14 +16435,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -16459,16 +16459,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -16689,14 +16689,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16736,16 +16736,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -17010,14 +17010,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17046,16 +17046,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -17342,14 +17342,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17389,16 +17389,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -17663,14 +17663,14 @@ type Bar_NormalRecur_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17699,16 +17699,16 @@ func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Args) FromWire(w wire.Value) error { var err error @@ -17995,14 +17995,14 @@ type Bar_NormalRecur_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18048,16 +18048,16 @@ func _BarResponseRecur_Read(w wire.Value) (*BarResponseRecur, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Result) FromWire(w wire.Value) error { var err error @@ -18329,14 +18329,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18379,16 +18379,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -18747,14 +18747,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -18808,16 +18808,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error @@ -19148,14 +19148,14 @@ type Echo_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19184,16 +19184,16 @@ func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -19465,14 +19465,14 @@ type Echo_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19504,16 +19504,16 @@ func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -19718,14 +19718,14 @@ type Echo_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19751,16 +19751,16 @@ func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -20024,14 +20024,14 @@ type Echo_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20063,16 +20063,16 @@ func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -20281,14 +20281,14 @@ type Echo_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20314,16 +20314,16 @@ func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -20587,14 +20587,14 @@ type Echo_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20626,16 +20626,16 @@ func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -20856,14 +20856,14 @@ func Default_Echo_EchoEnum_Args() *Echo_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20895,16 +20895,16 @@ func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -21184,14 +21184,14 @@ type Echo_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21223,16 +21223,16 @@ func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -21441,14 +21441,14 @@ type Echo_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21474,16 +21474,16 @@ func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -21747,14 +21747,14 @@ type Echo_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21786,16 +21786,16 @@ func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -22004,14 +22004,14 @@ type Echo_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22037,16 +22037,16 @@ func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -22310,14 +22310,14 @@ type Echo_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22349,16 +22349,16 @@ func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -22605,14 +22605,14 @@ func (_Map_I32_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22669,16 +22669,16 @@ func _Map_I32_BarResponse_Read(m wire.MapItemList) (map[int32]*BarResponse, erro // An error is returned if we were unable to build a Echo_EchoI32Map_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Args) FromWire(w wire.Value) error { var err error @@ -23057,14 +23057,14 @@ type Echo_EchoI32Map_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23096,16 +23096,16 @@ func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32Map_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Result) FromWire(w wire.Value) error { var err error @@ -23310,14 +23310,14 @@ type Echo_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23343,16 +23343,16 @@ func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -23616,14 +23616,14 @@ type Echo_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23655,16 +23655,16 @@ func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -23873,14 +23873,14 @@ type Echo_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23906,16 +23906,16 @@ func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -24179,14 +24179,14 @@ type Echo_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24218,16 +24218,16 @@ func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -24436,14 +24436,14 @@ type Echo_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24469,16 +24469,16 @@ func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -24742,14 +24742,14 @@ type Echo_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24781,16 +24781,16 @@ func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -24999,14 +24999,14 @@ type Echo_EchoStringList_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25032,16 +25032,16 @@ func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -25310,14 +25310,14 @@ type Echo_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25349,16 +25349,16 @@ func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -25601,14 +25601,14 @@ func (_Map_String_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25665,16 +25665,16 @@ func _Map_String_BarResponse_Read(m wire.MapItemList) (map[string]*BarResponse, // An error is returned if we were unable to build a Echo_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -26040,14 +26040,14 @@ type Echo_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26079,16 +26079,16 @@ func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -26319,14 +26319,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26374,16 +26374,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -26731,14 +26731,14 @@ type Echo_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26770,16 +26770,16 @@ func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -27013,14 +27013,14 @@ func (_List_BarResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27064,16 +27064,16 @@ func _List_BarResponse_Read(l wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -27419,14 +27419,14 @@ type Echo_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27458,16 +27458,16 @@ func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -27718,14 +27718,14 @@ func (_Map_BarResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27791,16 +27791,16 @@ func _Map_BarResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a Echo_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -28237,14 +28237,14 @@ type Echo_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28276,16 +28276,16 @@ func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -28522,14 +28522,14 @@ func (_Set_BarResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28577,16 +28577,16 @@ func _Set_BarResponse_sliceType_Read(s wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -28944,14 +28944,14 @@ type Echo_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28983,16 +28983,16 @@ func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -29197,14 +29197,14 @@ type Echo_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -29230,16 +29230,16 @@ func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -29503,14 +29503,14 @@ type Echo_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -29542,16 +29542,16 @@ func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go index b1bf4460d..595c9d0ab 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go @@ -25,14 +25,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -230,14 +230,14 @@ type NestHeaders struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestHeaders) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -271,16 +271,16 @@ func (v *NestHeaders) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestHeaders struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestHeaders -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestHeaders +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestHeaders) FromWire(w wire.Value) error { var err error @@ -508,14 +508,14 @@ type NestedStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestedStruct) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -549,16 +549,16 @@ func (v *NestedStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestedStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestedStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestedStruct) FromWire(w wire.Value) error { var err error @@ -785,14 +785,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -818,16 +818,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -1000,14 +1000,14 @@ type TransHeaders struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeaders) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1050,16 +1050,16 @@ func _Wrapped_Read(w wire.Value) (*Wrapped, error) { // An error is returned if we were unable to build a TransHeaders struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeaders -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeaders +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeaders) FromWire(w wire.Value) error { var err error @@ -1288,14 +1288,14 @@ type TransStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransStruct) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1344,16 +1344,16 @@ func _NestedStruct_Read(w wire.Value) (*NestedStruct, error) { // An error is returned if we were unable to build a TransStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransStruct) FromWire(w wire.Value) error { var err error @@ -1680,14 +1680,14 @@ type Wrapped struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Wrapped) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1730,16 +1730,16 @@ func _NestHeaders_Read(w wire.Value) (*NestHeaders, error) { // An error is returned if we were unable to build a Wrapped struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Wrapped -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Wrapped +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Wrapped) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go index a8c591721..60df83835 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go @@ -31,14 +31,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -247,14 +247,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -294,16 +294,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -570,8 +570,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -628,10 +628,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -648,16 +648,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -665,13 +665,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -762,14 +762,14 @@ type GetProfileRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileRequest) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -801,16 +801,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a GetProfileRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileRequest) FromWire(w wire.Value) error { var err error @@ -1007,14 +1007,14 @@ func (_List_Profile_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1064,16 +1064,16 @@ func _List_Profile_Read(l wire.ValueList) ([]*Profile, error) { // An error is returned if we were unable to build a GetProfileResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileResponse) FromWire(w wire.Value) error { var err error @@ -1322,14 +1322,14 @@ type HeaderSchema struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *HeaderSchema) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1346,16 +1346,16 @@ func (v *HeaderSchema) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a HeaderSchema struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v HeaderSchema -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v HeaderSchema +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *HeaderSchema) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1465,14 +1465,14 @@ type OtherAuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OtherAuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1498,16 +1498,16 @@ func (v *OtherAuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OtherAuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OtherAuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OtherAuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OtherAuthErr) FromWire(w wire.Value) error { var err error @@ -1679,14 +1679,14 @@ type Profile struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Profile) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1721,16 +1721,16 @@ func _Recur1_Read(w wire.Value) (*Recur1, error) { // An error is returned if we were unable to build a Profile struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Profile -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Profile +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Profile) FromWire(w wire.Value) error { var err error @@ -1944,14 +1944,14 @@ func (_Map_UUID_Recur2_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2014,16 +2014,16 @@ func _Map_UUID_Recur2_Read(m wire.MapItemList) (map[UUID]*Recur2, error) { // An error is returned if we were unable to build a Recur1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur1) FromWire(w wire.Value) error { var err error @@ -2294,14 +2294,14 @@ type Recur2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur2) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2344,16 +2344,16 @@ func _Recur3_Read(w wire.Value) (*Recur3, error) { // An error is returned if we were unable to build a Recur2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur2) FromWire(w wire.Value) error { var err error @@ -2580,14 +2580,14 @@ type Recur3 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur3) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2613,16 +2613,16 @@ func (v *Recur3) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Recur3 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur3 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur3 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur3) FromWire(w wire.Value) error { var err error @@ -2838,14 +2838,14 @@ type TransHeaderType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeaderType) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -2916,16 +2916,16 @@ func (v *TransHeaderType) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TransHeaderType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeaderType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeaderType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeaderType) FromWire(w wire.Value) error { var err error @@ -3438,14 +3438,14 @@ type SecondService_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3474,16 +3474,16 @@ func (v *SecondService_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -3755,14 +3755,14 @@ type SecondService_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3794,16 +3794,16 @@ func (v *SecondService_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -4008,14 +4008,14 @@ type SecondService_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4041,16 +4041,16 @@ func (v *SecondService_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -4314,14 +4314,14 @@ type SecondService_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4353,16 +4353,16 @@ func (v *SecondService_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -4581,14 +4581,14 @@ type SecondService_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4614,16 +4614,16 @@ func (v *SecondService_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -4887,14 +4887,14 @@ type SecondService_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4926,16 +4926,16 @@ func (v *SecondService_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -5156,14 +5156,14 @@ func Default_SecondService_EchoEnum_Args() *SecondService_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5201,16 +5201,16 @@ func _Fruit_Read(w wire.Value) (Fruit, error) { // An error is returned if we were unable to build a SecondService_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -5506,14 +5506,14 @@ type SecondService_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5545,16 +5545,16 @@ func (v *SecondService_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -5763,14 +5763,14 @@ type SecondService_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5796,16 +5796,16 @@ func (v *SecondService_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -6069,14 +6069,14 @@ type SecondService_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6108,16 +6108,16 @@ func (v *SecondService_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -6336,14 +6336,14 @@ type SecondService_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6369,16 +6369,16 @@ func (v *SecondService_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -6642,14 +6642,14 @@ type SecondService_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6681,16 +6681,16 @@ func (v *SecondService_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -6899,14 +6899,14 @@ type SecondService_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6932,16 +6932,16 @@ func (v *SecondService_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -7205,14 +7205,14 @@ type SecondService_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7244,16 +7244,16 @@ func (v *SecondService_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -7472,14 +7472,14 @@ type SecondService_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7505,16 +7505,16 @@ func (v *SecondService_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -7778,14 +7778,14 @@ type SecondService_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7817,16 +7817,16 @@ func (v *SecondService_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -8045,14 +8045,14 @@ type SecondService_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8078,16 +8078,16 @@ func (v *SecondService_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -8351,14 +8351,14 @@ type SecondService_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8390,16 +8390,16 @@ func (v *SecondService_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -8644,14 +8644,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8695,16 +8695,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a SecondService_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -9047,14 +9047,14 @@ type SecondService_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9086,16 +9086,16 @@ func (v *SecondService_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -9338,14 +9338,14 @@ func (_Map_String_BazResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9408,16 +9408,16 @@ func _Map_String_BazResponse_Read(m wire.MapItemList) (map[string]*base.BazRespo // An error is returned if we were unable to build a SecondService_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -9789,14 +9789,14 @@ type SecondService_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9828,16 +9828,16 @@ func (v *SecondService_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -10068,14 +10068,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10123,16 +10123,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a SecondService_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -10480,14 +10480,14 @@ type SecondService_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10519,16 +10519,16 @@ func (v *SecondService_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -10762,14 +10762,14 @@ func (_List_BazResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10813,16 +10813,16 @@ func _List_BazResponse_Read(l wire.ValueList) ([]*base.BazResponse, error) { // An error is returned if we were unable to build a SecondService_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -11168,14 +11168,14 @@ type SecondService_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11207,16 +11207,16 @@ func (v *SecondService_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -11467,14 +11467,14 @@ func (_Map_BazResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11540,16 +11540,16 @@ func _Map_BazResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a SecondService_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -11986,14 +11986,14 @@ type SecondService_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12025,16 +12025,16 @@ func (v *SecondService_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -12271,14 +12271,14 @@ func (_Set_BazResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12326,16 +12326,16 @@ func _Set_BazResponse_sliceType_Read(s wire.ValueList) ([]*base.BazResponse, err // An error is returned if we were unable to build a SecondService_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -12693,14 +12693,14 @@ type SecondService_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12732,16 +12732,16 @@ func (v *SecondService_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -12946,14 +12946,14 @@ type SecondService_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12985,16 +12985,16 @@ func _UUID_1_Read(w wire.Value) (base.UUID, error) { // An error is returned if we were unable to build a SecondService_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -13264,14 +13264,14 @@ type SecondService_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -13303,16 +13303,16 @@ func (v *SecondService_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoTypedef_Result) FromWire(w wire.Value) error { var err error @@ -13533,14 +13533,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13591,16 +13591,16 @@ func _BazRequest_Read(w wire.Value) (*BazRequest, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -13999,14 +13999,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -14044,16 +14044,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -14266,14 +14266,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14318,16 +14318,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -14720,14 +14720,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -14759,16 +14759,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -14974,14 +14974,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15019,16 +15019,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -15387,14 +15387,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -15448,16 +15448,16 @@ func _OtherAuthErr_Read(w wire.Value) (*OtherAuthErr, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -15788,14 +15788,14 @@ type SimpleService_GetProfile_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -15830,16 +15830,16 @@ func _GetProfileRequest_Read(w wire.Value) (*GetProfileRequest, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Args) FromWire(w wire.Value) error { var err error @@ -16132,14 +16132,14 @@ type SimpleService_GetProfile_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16185,16 +16185,16 @@ func _GetProfileResponse_Read(w wire.Value) (*GetProfileResponse, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Result) FromWire(w wire.Value) error { var err error @@ -16465,14 +16465,14 @@ type SimpleService_HeaderSchema_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16507,16 +16507,16 @@ func _HeaderSchema_Read(w wire.Value) (*HeaderSchema, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Args) FromWire(w wire.Value) error { var err error @@ -16821,14 +16821,14 @@ type SimpleService_HeaderSchema_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -16876,16 +16876,16 @@ func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Result) FromWire(w wire.Value) error { var err error @@ -17209,14 +17209,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -17233,16 +17233,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -17448,14 +17448,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17487,16 +17487,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -17700,14 +17700,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -17724,16 +17724,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -17956,14 +17956,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18009,16 +18009,16 @@ func _ServerErr_Read(w wire.Value) (*base.ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error @@ -18288,14 +18288,14 @@ type SimpleService_TestUuid_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -18312,16 +18312,16 @@ func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -18517,14 +18517,14 @@ type SimpleService_TestUuid_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -18541,16 +18541,16 @@ func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -18679,14 +18679,14 @@ type SimpleService_Trans_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18729,16 +18729,16 @@ func _TransStruct_Read(w wire.Value) (*base.TransStruct, error) { // An error is returned if we were unable to build a SimpleService_Trans_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Args) FromWire(w wire.Value) error { var err error @@ -19097,14 +19097,14 @@ type SimpleService_Trans_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -19152,16 +19152,16 @@ func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Trans_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Result) FromWire(w wire.Value) error { var err error @@ -19486,14 +19486,14 @@ type SimpleService_TransHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19528,16 +19528,16 @@ func _TransHeaders_Read(w wire.Value) (*base.TransHeaders, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Args) FromWire(w wire.Value) error { var err error @@ -19842,14 +19842,14 @@ type SimpleService_TransHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -19897,16 +19897,16 @@ func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Result) FromWire(w wire.Value) error { var err error @@ -20234,14 +20234,14 @@ type SimpleService_TransHeadersNoReq_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -20299,16 +20299,16 @@ func _NestedStruct_Read(w wire.Value) (*base.NestedStruct, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Args) FromWire(w wire.Value) error { var err error @@ -20771,14 +20771,14 @@ type SimpleService_TransHeadersNoReq_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -20818,16 +20818,16 @@ func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Result) FromWire(w wire.Value) error { var err error @@ -21092,14 +21092,14 @@ type SimpleService_TransHeadersType_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21134,16 +21134,16 @@ func _TransHeaderType_Read(w wire.Value) (*TransHeaderType, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Args) FromWire(w wire.Value) error { var err error @@ -21448,14 +21448,14 @@ type SimpleService_TransHeadersType_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -21503,16 +21503,16 @@ func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Result) FromWire(w wire.Value) error { var err error @@ -21836,14 +21836,14 @@ type SimpleService_UrlTest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -21860,16 +21860,16 @@ func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -22065,14 +22065,14 @@ type SimpleService_UrlTest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -22089,16 +22089,16 @@ func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go b/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go index 3671161ef..41984a4b8 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go @@ -24,14 +24,14 @@ type BadRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BadRequest) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *BadRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BadRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BadRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BadRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BadRequest) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -207,14 +207,14 @@ func (_List_ContactFragment_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contact) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -280,16 +280,16 @@ func _ContactAttributes_Read(w wire.Value) (*ContactAttributes, error) { // An error is returned if we were unable to build a Contact struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contact -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contact +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contact) FromWire(w wire.Value) error { var err error @@ -603,14 +603,14 @@ type ContactAttributes struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactAttributes) ToWire() (wire.Value, error) { var ( fields [13]wire.Field @@ -734,16 +734,16 @@ func (v *ContactAttributes) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ContactAttributes struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactAttributes -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactAttributes) FromWire(w wire.Value) error { var err error @@ -1600,14 +1600,14 @@ type ContactFragment struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactFragment) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1649,16 +1649,16 @@ func _ContactFragmentType_Read(w wire.Value) (ContactFragmentType, error) { // An error is returned if we were unable to build a ContactFragment struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactFragment -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactFragment +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactFragment) FromWire(w wire.Value) error { var err error @@ -1942,14 +1942,14 @@ type NotFound struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotFound) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1966,16 +1966,16 @@ func (v *NotFound) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotFound struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotFound -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotFound +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotFound) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2125,14 +2125,14 @@ func (_List_Contact_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsRequest) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2189,16 +2189,16 @@ func _List_Contact_Read(l wire.ValueList) ([]*Contact, error) { // An error is returned if we were unable to build a SaveContactsRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsRequest) FromWire(w wire.Value) error { var err error @@ -2496,14 +2496,14 @@ type SaveContactsResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsResponse) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2520,16 +2520,16 @@ func (v *SaveContactsResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SaveContactsResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsResponse) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2690,14 +2690,14 @@ type Contacts_SaveContacts_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2732,16 +2732,16 @@ func _SaveContactsRequest_Read(w wire.Value) (*SaveContactsRequest, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Args) FromWire(w wire.Value) error { var err error @@ -3046,14 +3046,14 @@ type Contacts_SaveContacts_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3119,16 +3119,16 @@ func _NotFound_Read(w wire.Value) (*NotFound, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Result) FromWire(w wire.Value) error { var err error @@ -3470,14 +3470,14 @@ type Contacts_TestUrlUrl_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3494,16 +3494,16 @@ func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3709,14 +3709,14 @@ type Contacts_TestUrlUrl_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3748,16 +3748,16 @@ func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go b/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go index 11f173d5d..5f1599bcf 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go @@ -24,14 +24,14 @@ type Foo struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Foo) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *Foo) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Foo struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Foo -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Foo +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Foo) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -166,14 +166,14 @@ type NotModified struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotModified) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -190,16 +190,16 @@ func (v *NotModified) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotModified struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotModified -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotModified +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotModified) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -322,14 +322,14 @@ type Corge_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -355,16 +355,16 @@ func (v *Corge_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -628,14 +628,14 @@ type Corge_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -667,16 +667,16 @@ func (v *Corge_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -895,14 +895,14 @@ type Corge_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -928,16 +928,16 @@ func (v *Corge_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -1201,14 +1201,14 @@ type Corge_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1240,16 +1240,16 @@ func (v *Corge_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -1468,14 +1468,14 @@ type Corge_NoContent_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContent_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1501,16 +1501,16 @@ func (v *Corge_NoContent_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContent_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContent_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContent_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContent_Args) FromWire(w wire.Value) error { var err error @@ -1779,14 +1779,14 @@ type Corge_NoContent_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContent_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1824,16 +1824,16 @@ func _NotModified_Read(w wire.Value) (*NotModified, error) { // An error is returned if we were unable to build a Corge_NoContent_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContent_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContent_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContent_Result) FromWire(w wire.Value) error { var err error @@ -2044,14 +2044,14 @@ type Corge_NoContentNoException_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentNoException_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2077,16 +2077,16 @@ func (v *Corge_NoContentNoException_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentNoException_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentNoException_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentNoException_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentNoException_Args) FromWire(w wire.Value) error { var err error @@ -2340,14 +2340,14 @@ type Corge_NoContentNoException_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentNoException_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2364,16 +2364,16 @@ func (v *Corge_NoContentNoException_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentNoException_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentNoException_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentNoException_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentNoException_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2501,14 +2501,14 @@ type Corge_NoContentOnException_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentOnException_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2534,16 +2534,16 @@ func (v *Corge_NoContentOnException_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentOnException_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentOnException_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentOnException_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentOnException_Args) FromWire(w wire.Value) error { var err error @@ -2822,14 +2822,14 @@ type Corge_NoContentOnException_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentOnException_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2875,16 +2875,16 @@ func _Foo_Read(w wire.Value) (*Foo, error) { // An error is returned if we were unable to build a Corge_NoContentOnException_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentOnException_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentOnException_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentOnException_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go b/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go index ac9418fe6..5fcf5f61d 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go @@ -107,10 +107,10 @@ type FxEchoYARPCClientResult struct { // NewFxEchoYARPCClient provides a EchoYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCClient("service-name"), +// ... +// ) func NewFxEchoYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoYARPCClientParams) FxEchoYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxEchoYARPCProceduresResult struct { // NewFxEchoYARPCProcedures provides EchoYARPCServer procedures to an Fx application. // It expects a EchoYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCProcedures(), +// ... +// ) func NewFxEchoYARPCProcedures() interface{} { return func(params FxEchoYARPCProceduresParams) FxEchoYARPCProceduresResult { return FxEchoYARPCProceduresResult{ diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go index b53de2e66..6a6319ad1 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go index 952c40476..1dc2efe9d 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go b/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go index 90f9d62d5..b5d3d057a 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go @@ -27,14 +27,14 @@ type GoogleNowService_AddCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_AddCredentials_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *GoogleNowService_AddCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_AddCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_AddCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_AddCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_AddCredentials_Args) FromWire(w wire.Value) error { var err error @@ -323,14 +323,14 @@ type GoogleNowService_AddCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_AddCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -347,16 +347,16 @@ func (v *GoogleNowService_AddCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_AddCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_AddCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_AddCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_AddCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -483,14 +483,14 @@ type GoogleNowService_CheckCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_CheckCredentials_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -507,16 +507,16 @@ func (v *GoogleNowService_CheckCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_CheckCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_CheckCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_CheckCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_CheckCredentials_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -712,14 +712,14 @@ type GoogleNowService_CheckCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_CheckCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -736,16 +736,16 @@ func (v *GoogleNowService_CheckCredentials_Result) ToWire() (wire.Value, error) // An error is returned if we were unable to build a GoogleNowService_CheckCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_CheckCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_CheckCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_CheckCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go b/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go index 3cc22c40a..669caf5c0 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go @@ -26,14 +26,14 @@ type ServiceABack_HelloA_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceABack_HelloA_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *ServiceABack_HelloA_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceABack_HelloA_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceABack_HelloA_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceABack_HelloA_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceABack_HelloA_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type ServiceABack_HelloA_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceABack_HelloA_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *ServiceABack_HelloA_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceABack_HelloA_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceABack_HelloA_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceABack_HelloA_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceABack_HelloA_Result) FromWire(w wire.Value) error { var err error @@ -531,14 +531,14 @@ type ServiceBBack_HelloB_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBBack_HelloB_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -555,16 +555,16 @@ func (v *ServiceBBack_HelloB_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBBack_HelloB_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBBack_HelloB_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBBack_HelloB_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBBack_HelloB_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -770,14 +770,14 @@ type ServiceBBack_HelloB_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBBack_HelloB_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -809,16 +809,16 @@ func (v *ServiceBBack_HelloB_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBBack_HelloB_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBBack_HelloB_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBBack_HelloB_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBBack_HelloB_Result) FromWire(w wire.Value) error { var err error @@ -1026,14 +1026,14 @@ type ServiceCBack_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCBack_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1050,16 +1050,16 @@ func (v *ServiceCBack_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCBack_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCBack_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCBack_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCBack_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1265,14 +1265,14 @@ type ServiceCBack_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCBack_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1304,16 +1304,16 @@ func (v *ServiceCBack_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCBack_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCBack_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCBack_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCBack_Hello_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go b/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go index 9bf9bc20f..c93f1aa61 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go @@ -25,14 +25,14 @@ type ExceptionType1 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ExceptionType1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *ExceptionType1) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ExceptionType1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ExceptionType1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ExceptionType1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ExceptionType1) FromWire(w wire.Value) error { var err error @@ -239,14 +239,14 @@ type ExceptionType2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ExceptionType2) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -272,16 +272,16 @@ func (v *ExceptionType2) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ExceptionType2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ExceptionType2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ExceptionType2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ExceptionType2) FromWire(w wire.Value) error { var err error @@ -452,14 +452,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -476,16 +476,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -597,14 +597,14 @@ type WithExceptions_Func1_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -621,16 +621,16 @@ func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -863,14 +863,14 @@ type WithExceptions_Func1_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -936,16 +936,16 @@ func _ExceptionType2_Read(w wire.Value) (*ExceptionType2, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go index d92699ddb..f113f39ce 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go @@ -26,14 +26,14 @@ type AppDemoService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AppDemoService_Call_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *AppDemoService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AppDemoService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AppDemoService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AppDemoService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AppDemoService_Call_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type AppDemoService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AppDemoService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *AppDemoService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AppDemoService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AppDemoService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AppDemoService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AppDemoService_Call_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go index 32e9119c1..b1186bbfd 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -856,14 +856,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1006,16 +1006,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1698,8 +1698,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -1756,10 +1756,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -1776,16 +1776,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -1793,13 +1793,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -1897,8 +1897,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -1955,10 +1955,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -1975,16 +1975,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -1992,13 +1992,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2137,14 +2137,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2170,16 +2170,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -2344,14 +2344,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -2401,16 +2401,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -2777,14 +2777,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -2859,16 +2859,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -3326,14 +3326,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -3375,16 +3375,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -3602,14 +3602,14 @@ type SeeOthersRedirection struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3626,16 +3626,16 @@ func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SeeOthersRedirection struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SeeOthersRedirection -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SeeOthersRedirection +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SeeOthersRedirection) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4066,14 +4066,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4099,16 +4099,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -4377,14 +4377,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4422,16 +4422,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -4643,14 +4643,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4684,16 +4684,16 @@ func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5015,14 +5015,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5054,16 +5054,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -5347,14 +5347,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -5637,16 +5637,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -7684,14 +7684,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7723,16 +7723,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -7940,14 +7940,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -7997,16 +7997,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8444,14 +8444,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8483,16 +8483,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8698,14 +8698,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -8754,16 +8754,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9101,14 +9101,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9140,16 +9140,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9355,14 +9355,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9402,16 +9402,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -9735,14 +9735,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9774,16 +9774,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -9989,14 +9989,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10038,16 +10038,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -10377,14 +10377,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10416,16 +10416,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -10630,14 +10630,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10665,16 +10665,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -10942,14 +10942,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10981,16 +10981,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -11224,14 +11224,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -11298,16 +11298,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -11816,14 +11816,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11855,16 +11855,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12070,14 +12070,14 @@ type Bar_DeleteWithBody_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -12111,16 +12111,16 @@ func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Args) FromWire(w wire.Value) error { var err error @@ -12432,14 +12432,14 @@ type Bar_DeleteWithBody_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12456,16 +12456,16 @@ func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -12594,14 +12594,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -12635,16 +12635,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12956,14 +12956,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12980,16 +12980,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13116,14 +13116,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13140,16 +13140,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13382,14 +13382,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13443,16 +13443,16 @@ func _SeeOthersRedirection_Read(w wire.Value) (*SeeOthersRedirection, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -13789,14 +13789,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13838,16 +13838,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -14253,14 +14253,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14300,16 +14300,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -14577,14 +14577,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14601,16 +14601,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14831,14 +14831,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14878,16 +14878,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -15151,14 +15151,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15175,16 +15175,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15405,14 +15405,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15452,16 +15452,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -15726,14 +15726,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -15762,16 +15762,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -16058,14 +16058,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16105,16 +16105,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -16380,14 +16380,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16430,16 +16430,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -16798,14 +16798,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -16859,16 +16859,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go index 7f8322101..936aeb2b6 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go @@ -25,14 +25,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -241,14 +241,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -288,16 +288,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -557,14 +557,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -590,16 +590,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -761,14 +761,14 @@ type GetProfileRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileRequest) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -800,16 +800,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a GetProfileRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileRequest) FromWire(w wire.Value) error { var err error @@ -1006,14 +1006,14 @@ func (_List_Profile_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1063,16 +1063,16 @@ func _List_Profile_Read(l wire.ValueList) ([]*Profile, error) { // An error is returned if we were unable to build a GetProfileResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileResponse) FromWire(w wire.Value) error { var err error @@ -1321,14 +1321,14 @@ type HeaderSchema struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *HeaderSchema) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1345,16 +1345,16 @@ func (v *HeaderSchema) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a HeaderSchema struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v HeaderSchema -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v HeaderSchema +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *HeaderSchema) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1465,14 +1465,14 @@ type NestedStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestedStruct) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1506,16 +1506,16 @@ func (v *NestedStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestedStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestedStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestedStruct) FromWire(w wire.Value) error { var err error @@ -1742,14 +1742,14 @@ type OtherAuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OtherAuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1775,16 +1775,16 @@ func (v *OtherAuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OtherAuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OtherAuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OtherAuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OtherAuthErr) FromWire(w wire.Value) error { var err error @@ -1956,14 +1956,14 @@ type Profile struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Profile) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1998,16 +1998,16 @@ func _Recur1_Read(w wire.Value) (*Recur1, error) { // An error is returned if we were unable to build a Profile struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Profile -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Profile +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Profile) FromWire(w wire.Value) error { var err error @@ -2221,14 +2221,14 @@ func (_Map_UUID_Recur2_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2291,16 +2291,16 @@ func _Map_UUID_Recur2_Read(m wire.MapItemList) (map[UUID]*Recur2, error) { // An error is returned if we were unable to build a Recur1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur1) FromWire(w wire.Value) error { var err error @@ -2571,14 +2571,14 @@ type Recur2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur2) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2622,16 +2622,16 @@ func _Recur3_Read(w wire.Value) (*Recur3, error) { // An error is returned if we were unable to build a Recur2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur2) FromWire(w wire.Value) error { var err error @@ -2864,14 +2864,14 @@ type Recur3 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur3) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2897,16 +2897,16 @@ func (v *Recur3) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Recur3 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur3 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur3 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur3) FromWire(w wire.Value) error { var err error @@ -3068,14 +3068,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3101,16 +3101,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -3281,14 +3281,14 @@ type TransHeader struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeader) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3305,16 +3305,16 @@ func (v *TransHeader) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TransHeader struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeader -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeader +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeader) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3426,14 +3426,14 @@ type TransStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransStruct) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3482,16 +3482,16 @@ func _NestedStruct_Read(w wire.Value) (*NestedStruct, error) { // An error is returned if we were unable to build a TransStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransStruct) FromWire(w wire.Value) error { var err error @@ -3822,14 +3822,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3880,16 +3880,16 @@ func _BazRequest_Read(w wire.Value) (*BazRequest, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -4308,14 +4308,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4353,16 +4353,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -4575,14 +4575,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -4627,16 +4627,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -5029,14 +5029,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5068,16 +5068,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -5283,14 +5283,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -5328,16 +5328,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -5696,14 +5696,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5763,16 +5763,16 @@ func _OtherAuthErr_Read(w wire.Value) (*OtherAuthErr, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -6109,14 +6109,14 @@ type SimpleService_GetProfile_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6151,16 +6151,16 @@ func _GetProfileRequest_Read(w wire.Value) (*GetProfileRequest, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Args) FromWire(w wire.Value) error { var err error @@ -6453,14 +6453,14 @@ type SimpleService_GetProfile_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -6506,16 +6506,16 @@ func _GetProfileResponse_Read(w wire.Value) (*GetProfileResponse, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Result) FromWire(w wire.Value) error { var err error @@ -6786,14 +6786,14 @@ type SimpleService_HeaderSchema_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6828,16 +6828,16 @@ func _HeaderSchema_Read(w wire.Value) (*HeaderSchema, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Args) FromWire(w wire.Value) error { var err error @@ -7142,14 +7142,14 @@ type SimpleService_HeaderSchema_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -7197,16 +7197,16 @@ func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Result) FromWire(w wire.Value) error { var err error @@ -7530,14 +7530,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -7554,16 +7554,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -7769,14 +7769,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7808,16 +7808,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -8021,14 +8021,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8045,16 +8045,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -8277,14 +8277,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -8330,16 +8330,16 @@ func _ServerErr_Read(w wire.Value) (*ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error @@ -8609,14 +8609,14 @@ type SimpleService_TestUuid_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8633,16 +8633,16 @@ func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -8838,14 +8838,14 @@ type SimpleService_TestUuid_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8862,16 +8862,16 @@ func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -9000,14 +9000,14 @@ type SimpleService_Trans_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9050,16 +9050,16 @@ func _TransStruct_Read(w wire.Value) (*TransStruct, error) { // An error is returned if we were unable to build a SimpleService_Trans_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Args) FromWire(w wire.Value) error { var err error @@ -9418,14 +9418,14 @@ type SimpleService_Trans_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -9473,16 +9473,16 @@ func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Trans_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Result) FromWire(w wire.Value) error { var err error @@ -9807,14 +9807,14 @@ type SimpleService_TransHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9849,16 +9849,16 @@ func _TransHeader_Read(w wire.Value) (*TransHeader, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Args) FromWire(w wire.Value) error { var err error @@ -10163,14 +10163,14 @@ type SimpleService_TransHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -10218,16 +10218,16 @@ func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Result) FromWire(w wire.Value) error { var err error @@ -10551,14 +10551,14 @@ type SimpleService_TransHeadersNoReq_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -10575,16 +10575,16 @@ func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -10805,14 +10805,14 @@ type SimpleService_TransHeadersNoReq_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10852,16 +10852,16 @@ func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Result) FromWire(w wire.Value) error { var err error @@ -11126,14 +11126,14 @@ type SimpleService_TransHeadersType_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11162,16 +11162,16 @@ func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Args) FromWire(w wire.Value) error { var err error @@ -11470,14 +11470,14 @@ type SimpleService_TransHeadersType_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -11525,16 +11525,16 @@ func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Result) FromWire(w wire.Value) error { var err error @@ -11858,14 +11858,14 @@ type SimpleService_UrlTest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -11882,16 +11882,16 @@ func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -12087,14 +12087,14 @@ type SimpleService_UrlTest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12111,16 +12111,16 @@ func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go index 109ea1040..2196bf6a4 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go @@ -27,14 +27,14 @@ type Bounce_Bounce_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Bounce_Bounce_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go index b63d2761f..78d51e070 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go @@ -26,14 +26,14 @@ type Request struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Request) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -69,16 +69,16 @@ func (v *Request) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Request struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Request -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Request +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Request) FromWire(w wire.Value) error { var err error @@ -310,14 +310,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -353,16 +353,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { var err error @@ -587,14 +587,14 @@ type Clientless_Beta_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_Beta_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -636,16 +636,16 @@ func _Request_Read(w wire.Value) (*Request, error) { // An error is returned if we were unable to build a Clientless_Beta_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_Beta_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_Beta_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_Beta_Args) FromWire(w wire.Value) error { var err error @@ -973,14 +973,14 @@ type Clientless_Beta_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_Beta_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1018,16 +1018,16 @@ func _Response_Read(w wire.Value) (*Response, error) { // An error is returned if we were unable to build a Clientless_Beta_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_Beta_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_Beta_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_Beta_Result) FromWire(w wire.Value) error { var err error @@ -1239,14 +1239,14 @@ type Clientless_ClientlessArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_ClientlessArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1280,16 +1280,16 @@ func (v *Clientless_ClientlessArgWithHeaders_Args) ToWire() (wire.Value, error) // An error is returned if we were unable to build a Clientless_ClientlessArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_ClientlessArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_ClientlessArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_ClientlessArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -1611,14 +1611,14 @@ type Clientless_ClientlessArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_ClientlessArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1650,16 +1650,16 @@ func (v *Clientless_ClientlessArgWithHeaders_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Clientless_ClientlessArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_ClientlessArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_ClientlessArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_ClientlessArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -1864,14 +1864,14 @@ type Clientless_EmptyclientlessRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_EmptyclientlessRequest_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1899,16 +1899,16 @@ func (v *Clientless_EmptyclientlessRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Clientless_EmptyclientlessRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_EmptyclientlessRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_EmptyclientlessRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_EmptyclientlessRequest_Args) FromWire(w wire.Value) error { var err error @@ -2166,14 +2166,14 @@ type Clientless_EmptyclientlessRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_EmptyclientlessRequest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2190,16 +2190,16 @@ func (v *Clientless_EmptyclientlessRequest_Result) ToWire() (wire.Value, error) // An error is returned if we were unable to build a Clientless_EmptyclientlessRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_EmptyclientlessRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_EmptyclientlessRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_EmptyclientlessRequest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go index 3671161ef..41984a4b8 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go @@ -24,14 +24,14 @@ type BadRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BadRequest) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *BadRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BadRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BadRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BadRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BadRequest) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -207,14 +207,14 @@ func (_List_ContactFragment_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contact) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -280,16 +280,16 @@ func _ContactAttributes_Read(w wire.Value) (*ContactAttributes, error) { // An error is returned if we were unable to build a Contact struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contact -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contact +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contact) FromWire(w wire.Value) error { var err error @@ -603,14 +603,14 @@ type ContactAttributes struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactAttributes) ToWire() (wire.Value, error) { var ( fields [13]wire.Field @@ -734,16 +734,16 @@ func (v *ContactAttributes) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ContactAttributes struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactAttributes -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactAttributes) FromWire(w wire.Value) error { var err error @@ -1600,14 +1600,14 @@ type ContactFragment struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactFragment) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1649,16 +1649,16 @@ func _ContactFragmentType_Read(w wire.Value) (ContactFragmentType, error) { // An error is returned if we were unable to build a ContactFragment struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactFragment -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactFragment +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactFragment) FromWire(w wire.Value) error { var err error @@ -1942,14 +1942,14 @@ type NotFound struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotFound) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1966,16 +1966,16 @@ func (v *NotFound) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotFound struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotFound -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotFound +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotFound) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2125,14 +2125,14 @@ func (_List_Contact_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsRequest) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2189,16 +2189,16 @@ func _List_Contact_Read(l wire.ValueList) ([]*Contact, error) { // An error is returned if we were unable to build a SaveContactsRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsRequest) FromWire(w wire.Value) error { var err error @@ -2496,14 +2496,14 @@ type SaveContactsResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsResponse) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2520,16 +2520,16 @@ func (v *SaveContactsResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SaveContactsResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsResponse) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2690,14 +2690,14 @@ type Contacts_SaveContacts_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2732,16 +2732,16 @@ func _SaveContactsRequest_Read(w wire.Value) (*SaveContactsRequest, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Args) FromWire(w wire.Value) error { var err error @@ -3046,14 +3046,14 @@ type Contacts_SaveContacts_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3119,16 +3119,16 @@ func _NotFound_Read(w wire.Value) (*NotFound, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Result) FromWire(w wire.Value) error { var err error @@ -3470,14 +3470,14 @@ type Contacts_TestUrlUrl_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3494,16 +3494,16 @@ func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3709,14 +3709,14 @@ type Contacts_TestUrlUrl_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3748,16 +3748,16 @@ func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go index b53de2e66..6a6319ad1 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go index c5c2ee49d..2fe5c0dfc 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go index 5159ffae5..83aa729bd 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go @@ -27,14 +27,14 @@ type GoogleNow_AddCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_AddCredentials_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *GoogleNow_AddCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_AddCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_AddCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_AddCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_AddCredentials_Args) FromWire(w wire.Value) error { var err error @@ -323,14 +323,14 @@ type GoogleNow_AddCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_AddCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -347,16 +347,16 @@ func (v *GoogleNow_AddCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_AddCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_AddCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_AddCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_AddCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -483,14 +483,14 @@ type GoogleNow_CheckCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_CheckCredentials_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -507,16 +507,16 @@ func (v *GoogleNow_CheckCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_CheckCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_CheckCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_CheckCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_CheckCredentials_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -712,14 +712,14 @@ type GoogleNow_CheckCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_CheckCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -736,16 +736,16 @@ func (v *GoogleNow_CheckCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_CheckCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_CheckCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_CheckCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_CheckCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go index 65ebdf150..0c5f9cfa0 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go @@ -26,14 +26,14 @@ type Dgx struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Dgx) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -74,16 +74,16 @@ func (v *Dgx) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Dgx struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Dgx -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Dgx +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Dgx) FromWire(w wire.Value) error { var err error @@ -360,14 +360,14 @@ type Fred struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Fred) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -400,16 +400,16 @@ func (v *Fred) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Fred struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Fred -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Fred +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Fred) FromWire(w wire.Value) error { var err error @@ -621,14 +621,14 @@ type Garply struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Garply) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -664,16 +664,16 @@ func (v *Garply) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Garply struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Garply -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Garply +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Garply) FromWire(w wire.Value) error { var err error @@ -905,14 +905,14 @@ type Grault struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Grault) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -948,16 +948,16 @@ func (v *Grault) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Grault struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Grault -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Grault +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Grault) FromWire(w wire.Value) error { var err error @@ -1178,14 +1178,14 @@ type Thud struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Thud) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1213,16 +1213,16 @@ func (v *Thud) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Thud struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Thud -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Thud +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Thud) FromWire(w wire.Value) error { var err error @@ -1388,14 +1388,14 @@ type TokenOnly struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TokenOnly) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1421,16 +1421,16 @@ func (v *TokenOnly) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TokenOnly struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TokenOnly -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TokenOnly +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TokenOnly) FromWire(w wire.Value) error { var err error @@ -1592,14 +1592,14 @@ type UUIDOnly struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *UUIDOnly) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1625,16 +1625,16 @@ func (v *UUIDOnly) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a UUIDOnly struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v UUIDOnly -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v UUIDOnly +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *UUIDOnly) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go index d8a9090d3..0eb0fd252 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go @@ -26,14 +26,14 @@ type ServiceAFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceAFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *ServiceAFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceAFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceAFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceAFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceAFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type ServiceAFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceAFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *ServiceAFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceAFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceAFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceAFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceAFront_Hello_Result) FromWire(w wire.Value) error { var err error @@ -531,14 +531,14 @@ type ServiceBFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -555,16 +555,16 @@ func (v *ServiceBFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -770,14 +770,14 @@ type ServiceBFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -809,16 +809,16 @@ func (v *ServiceBFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBFront_Hello_Result) FromWire(w wire.Value) error { var err error @@ -1026,14 +1026,14 @@ type ServiceCFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1050,16 +1050,16 @@ func (v *ServiceCFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1265,14 +1265,14 @@ type ServiceCFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1304,16 +1304,16 @@ func (v *ServiceCFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCFront_Hello_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go index 57d2e4fb5..9ce0e679b 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go @@ -25,14 +25,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -241,14 +241,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -288,16 +288,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -557,14 +557,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -590,16 +590,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -761,14 +761,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -794,16 +794,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -1028,14 +1028,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1092,16 +1092,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -1526,14 +1526,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1571,16 +1571,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -1793,14 +1793,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1845,16 +1845,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -2247,14 +2247,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2286,16 +2286,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -2501,14 +2501,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2546,16 +2546,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -2902,14 +2902,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2955,16 +2955,16 @@ func _BazResponse_Read(w wire.Value) (*BazResponse, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -3235,14 +3235,14 @@ type SimpleService_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3268,16 +3268,16 @@ func (v *SimpleService_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Echo_Args) FromWire(w wire.Value) error { var err error @@ -3541,14 +3541,14 @@ type SimpleService_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3580,16 +3580,16 @@ func (v *SimpleService_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Echo_Result) FromWire(w wire.Value) error { var err error @@ -3807,14 +3807,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3831,16 +3831,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4046,14 +4046,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4085,16 +4085,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -4298,14 +4298,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -4322,16 +4322,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4554,14 +4554,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4607,16 +4607,16 @@ func _ServerErr_Read(w wire.Value) (*ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go index 25f07523a..ef55415d0 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go @@ -27,14 +27,14 @@ type Echo_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Echo_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go index ebc47b003..2e2a734a4 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go @@ -27,14 +27,14 @@ type SimpleService_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *SimpleService_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type SimpleService_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *SimpleService_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_EchoString_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go index 22430fa22..e660a22bb 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go @@ -25,14 +25,14 @@ type EndpointExceptionType1 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *EndpointExceptionType1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *EndpointExceptionType1) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a EndpointExceptionType1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v EndpointExceptionType1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v EndpointExceptionType1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *EndpointExceptionType1) FromWire(w wire.Value) error { var err error @@ -239,14 +239,14 @@ type EndpointExceptionType2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *EndpointExceptionType2) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -272,16 +272,16 @@ func (v *EndpointExceptionType2) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a EndpointExceptionType2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v EndpointExceptionType2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v EndpointExceptionType2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *EndpointExceptionType2) FromWire(w wire.Value) error { var err error @@ -452,14 +452,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -476,16 +476,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -597,14 +597,14 @@ type WithExceptions_Func1_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -621,16 +621,16 @@ func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -863,14 +863,14 @@ type WithExceptions_Func1_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -936,16 +936,16 @@ func _EndpointExceptionType2_Read(w wire.Value) (*EndpointExceptionType2, error) // An error is returned if we were unable to build a WithExceptions_Func1_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go b/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go index 58e436a48..4fff33491 100644 --- a/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go +++ b/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -781,14 +781,14 @@ type BarRequestRecur struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequestRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -828,16 +828,16 @@ func _BarRequestRecur_Read(w wire.Value) (*BarRequestRecur, error) { // An error is returned if we were unable to build a BarRequestRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequestRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequestRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequestRecur) FromWire(w wire.Value) error { var err error @@ -1132,14 +1132,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1282,16 +1282,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1994,14 +1994,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponseRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2052,16 +2052,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a BarResponseRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponseRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponseRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponseRecur) FromWire(w wire.Value) error { var err error @@ -2358,8 +2358,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -2416,10 +2416,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2436,16 +2436,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -2453,13 +2453,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2557,8 +2557,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -2615,10 +2615,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2635,16 +2635,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -2652,13 +2652,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2797,14 +2797,14 @@ type OptionalParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2832,16 +2832,16 @@ func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OptionalParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OptionalParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OptionalParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OptionalParamsStruct) FromWire(w wire.Value) error { var err error @@ -3017,14 +3017,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3050,16 +3050,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -3224,14 +3224,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -3281,16 +3281,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -3621,14 +3621,14 @@ type QueryParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -3685,16 +3685,16 @@ func (v *QueryParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -4078,14 +4078,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4127,16 +4127,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -4666,14 +4666,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4699,16 +4699,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -4977,14 +4977,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5022,16 +5022,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -5244,14 +5244,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5299,16 +5299,16 @@ func _OptionalParamsStruct_Read(w wire.Value) (*OptionalParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5690,14 +5690,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5729,16 +5729,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -6022,14 +6022,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -6312,16 +6312,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8359,14 +8359,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8398,16 +8398,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8615,14 +8615,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -8672,16 +8672,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9119,14 +9119,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9158,16 +9158,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9373,14 +9373,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9429,16 +9429,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9776,14 +9776,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9815,16 +9815,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -10030,14 +10030,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10077,16 +10077,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -10410,14 +10410,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10449,16 +10449,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -10664,14 +10664,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10713,16 +10713,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -11052,14 +11052,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11091,16 +11091,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -11305,14 +11305,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11340,16 +11340,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -11617,14 +11617,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11656,16 +11656,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -11899,14 +11899,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -11973,16 +11973,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12491,14 +12491,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12530,16 +12530,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12744,14 +12744,14 @@ type Bar_DeleteFoo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12777,16 +12777,16 @@ func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Args) FromWire(w wire.Value) error { var err error @@ -13040,14 +13040,14 @@ type Bar_DeleteFoo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13064,16 +13064,16 @@ func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13202,14 +13202,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13243,16 +13243,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -13564,14 +13564,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13588,16 +13588,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13724,14 +13724,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13748,16 +13748,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13978,14 +13978,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14025,16 +14025,16 @@ func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -14305,14 +14305,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14354,16 +14354,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -14769,14 +14769,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14816,16 +14816,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -15093,14 +15093,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15117,16 +15117,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15347,14 +15347,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15394,16 +15394,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -15667,14 +15667,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15691,16 +15691,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15921,14 +15921,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15968,16 +15968,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -16242,14 +16242,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16278,16 +16278,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -16574,14 +16574,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16621,16 +16621,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -16895,14 +16895,14 @@ type Bar_NormalRecur_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16931,16 +16931,16 @@ func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Args) FromWire(w wire.Value) error { var err error @@ -17227,14 +17227,14 @@ type Bar_NormalRecur_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17280,16 +17280,16 @@ func _BarResponseRecur_Read(w wire.Value) (*BarResponseRecur, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Result) FromWire(w wire.Value) error { var err error @@ -17561,14 +17561,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17611,16 +17611,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -17979,14 +17979,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -18040,16 +18040,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error @@ -18380,14 +18380,14 @@ type Echo_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18416,16 +18416,16 @@ func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -18697,14 +18697,14 @@ type Echo_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18736,16 +18736,16 @@ func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -18950,14 +18950,14 @@ type Echo_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18983,16 +18983,16 @@ func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -19256,14 +19256,14 @@ type Echo_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19295,16 +19295,16 @@ func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -19513,14 +19513,14 @@ type Echo_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19546,16 +19546,16 @@ func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -19819,14 +19819,14 @@ type Echo_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19858,16 +19858,16 @@ func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -20088,14 +20088,14 @@ func Default_Echo_EchoEnum_Args() *Echo_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20127,16 +20127,16 @@ func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -20416,14 +20416,14 @@ type Echo_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20455,16 +20455,16 @@ func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -20673,14 +20673,14 @@ type Echo_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20706,16 +20706,16 @@ func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -20979,14 +20979,14 @@ type Echo_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21018,16 +21018,16 @@ func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -21236,14 +21236,14 @@ type Echo_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21269,16 +21269,16 @@ func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -21542,14 +21542,14 @@ type Echo_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21581,16 +21581,16 @@ func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -21837,14 +21837,14 @@ func (_Map_I32_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21901,16 +21901,16 @@ func _Map_I32_BarResponse_Read(m wire.MapItemList) (map[int32]*BarResponse, erro // An error is returned if we were unable to build a Echo_EchoI32Map_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Args) FromWire(w wire.Value) error { var err error @@ -22289,14 +22289,14 @@ type Echo_EchoI32Map_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22328,16 +22328,16 @@ func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32Map_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Result) FromWire(w wire.Value) error { var err error @@ -22542,14 +22542,14 @@ type Echo_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22575,16 +22575,16 @@ func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -22848,14 +22848,14 @@ type Echo_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22887,16 +22887,16 @@ func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -23105,14 +23105,14 @@ type Echo_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23138,16 +23138,16 @@ func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -23411,14 +23411,14 @@ type Echo_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23450,16 +23450,16 @@ func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -23668,14 +23668,14 @@ type Echo_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23701,16 +23701,16 @@ func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -23974,14 +23974,14 @@ type Echo_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24013,16 +24013,16 @@ func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -24231,14 +24231,14 @@ type Echo_EchoStringList_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24264,16 +24264,16 @@ func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -24542,14 +24542,14 @@ type Echo_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24581,16 +24581,16 @@ func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -24833,14 +24833,14 @@ func (_Map_String_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24897,16 +24897,16 @@ func _Map_String_BarResponse_Read(m wire.MapItemList) (map[string]*BarResponse, // An error is returned if we were unable to build a Echo_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -25272,14 +25272,14 @@ type Echo_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25311,16 +25311,16 @@ func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -25551,14 +25551,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25606,16 +25606,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -25963,14 +25963,14 @@ type Echo_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26002,16 +26002,16 @@ func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -26245,14 +26245,14 @@ func (_List_BarResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26296,16 +26296,16 @@ func _List_BarResponse_Read(l wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -26651,14 +26651,14 @@ type Echo_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26690,16 +26690,16 @@ func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -26950,14 +26950,14 @@ func (_Map_BarResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27023,16 +27023,16 @@ func _Map_BarResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a Echo_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -27469,14 +27469,14 @@ type Echo_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27508,16 +27508,16 @@ func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -27754,14 +27754,14 @@ func (_Set_BarResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27809,16 +27809,16 @@ func _Set_BarResponse_sliceType_Read(s wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -28176,14 +28176,14 @@ type Echo_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28215,16 +28215,16 @@ func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -28429,14 +28429,14 @@ type Echo_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28462,16 +28462,16 @@ func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -28735,14 +28735,14 @@ type Echo_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28774,16 +28774,16 @@ func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go b/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go index b53de2e66..6a6319ad1 100644 --- a/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go +++ b/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go b/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go index 6136ddb2d..94b7ce514 100644 --- a/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go +++ b/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go b/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go index 109ea1040..2196bf6a4 100644 --- a/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go +++ b/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go @@ -27,14 +27,14 @@ type Bounce_Bounce_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Bounce_Bounce_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go b/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go index 25f07523a..ef55415d0 100644 --- a/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go +++ b/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go @@ -27,14 +27,14 @@ type Echo_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Echo_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go b/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go index 8b2da3861..7a5e6f298 100644 --- a/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go +++ b/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go @@ -107,10 +107,10 @@ type FxEchoYARPCClientResult struct { // NewFxEchoYARPCClient provides a EchoYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCClient("service-name"), +// ... +// ) func NewFxEchoYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoYARPCClientParams) FxEchoYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxEchoYARPCProceduresResult struct { // NewFxEchoYARPCProcedures provides EchoYARPCServer procedures to an Fx application. // It expects a EchoYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCProcedures(), +// ... +// ) func NewFxEchoYARPCProcedures() interface{} { return func(params FxEchoYARPCProceduresParams) FxEchoYARPCProceduresResult { return FxEchoYARPCProceduresResult{ @@ -311,10 +311,10 @@ type FxEchoInternalYARPCClientResult struct { // NewFxEchoInternalYARPCClient provides a EchoInternalYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoInternalYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoInternalYARPCClient("service-name"), +// ... +// ) func NewFxEchoInternalYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoInternalYARPCClientParams) FxEchoInternalYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -360,10 +360,10 @@ type FxEchoInternalYARPCProceduresResult struct { // NewFxEchoInternalYARPCProcedures provides EchoInternalYARPCServer procedures to an Fx application. // It expects a EchoInternalYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoInternalYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoInternalYARPCProcedures(), +// ... +// ) func NewFxEchoInternalYARPCProcedures() interface{} { return func(params FxEchoInternalYARPCProceduresParams) FxEchoInternalYARPCProceduresResult { return FxEchoInternalYARPCProceduresResult{ diff --git a/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go b/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go index 20f065baa..cee0d9f40 100644 --- a/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go +++ b/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go @@ -107,10 +107,10 @@ type FxMirrorYARPCClientResult struct { // NewFxMirrorYARPCClient provides a MirrorYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// mirror.NewFxMirrorYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorYARPCClient("service-name"), +// ... +// ) func NewFxMirrorYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxMirrorYARPCClientParams) FxMirrorYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxMirrorYARPCProceduresResult struct { // NewFxMirrorYARPCProcedures provides MirrorYARPCServer procedures to an Fx application. // It expects a MirrorYARPCServer to be present in the container. // -// fx.Provide( -// mirror.NewFxMirrorYARPCProcedures(), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorYARPCProcedures(), +// ... +// ) func NewFxMirrorYARPCProcedures() interface{} { return func(params FxMirrorYARPCProceduresParams) FxMirrorYARPCProceduresResult { return FxMirrorYARPCProceduresResult{ @@ -311,10 +311,10 @@ type FxMirrorInternalYARPCClientResult struct { // NewFxMirrorInternalYARPCClient provides a MirrorInternalYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// mirror.NewFxMirrorInternalYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorInternalYARPCClient("service-name"), +// ... +// ) func NewFxMirrorInternalYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxMirrorInternalYARPCClientParams) FxMirrorInternalYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -360,10 +360,10 @@ type FxMirrorInternalYARPCProceduresResult struct { // NewFxMirrorInternalYARPCProcedures provides MirrorInternalYARPCServer procedures to an Fx application. // It expects a MirrorInternalYARPCServer to be present in the container. // -// fx.Provide( -// mirror.NewFxMirrorInternalYARPCProcedures(), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorInternalYARPCProcedures(), +// ... +// ) func NewFxMirrorInternalYARPCProcedures() interface{} { return func(params FxMirrorInternalYARPCProceduresParams) FxMirrorInternalYARPCProceduresResult { return FxMirrorInternalYARPCProceduresResult{ diff --git a/runtime/error.go b/runtime/error.go index 919733129..9b0f767f5 100644 --- a/runtime/error.go +++ b/runtime/error.go @@ -26,9 +26,11 @@ type ErrorType int const ( // TChannelError are errors of type tchannel.SystemError TChannelError ErrorType = iota + 1 + // ClientException are client exceptions defined in the // client IDL. ClientException + // BadResponse are errors reading client response such // as undefined exceptions, empty response. BadResponse @@ -36,17 +38,19 @@ const ( //go:generate stringer -type=ErrorType -// Error extends error interface to set meta fields about +// Error is a wrapper on go error to provide meta fields about // error that are logged to improve error debugging, as well // as to facilitate error grouping and filtering in logs. type Error interface { error - // ErrorLocation is used for logging. It is the module - // identifier that produced the error. It should be one - // of client, middleware, endpoint. + + // ErrorLocation is the module identifier that produced + // the error. It should be one of client, middleware, endpoint. ErrorLocation() string - // ErrorType is for error grouping. + + // ErrorType is used for error grouping. ErrorType() ErrorType - // Unwrap to enable usage of func errors.As + + // Unwrap returns wrapped error. Unwrap() error } diff --git a/runtime/error_builder.go b/runtime/error_builder.go index 1cb0db7ac..649604e59 100644 --- a/runtime/error_builder.go +++ b/runtime/error_builder.go @@ -20,82 +20,59 @@ package zanzibar -import "go.uber.org/zap" - -const ( - logFieldErrorLocation = "errorLocation" - logFieldErrorType = "errorType" -) - -// ErrorBuilder provides useful functions to use Error. +// ErrorBuilder wraps input error into Error. type ErrorBuilder interface { - Error(err error, errType ErrorType) Error - LogFieldErrorLocation(err error) zap.Field - LogFieldErrorType(err error) zap.Field + Error(err error, errType ErrorType) error + + Rebuild(zErr Error, err error) error } // NewErrorBuilder creates an instance of ErrorBuilder. // Input module id is used as error location for Errors // created by this builder. -// -// PseudoErrLocation is prefixed with "~" to identify -// logged error that is not created in the present module. func NewErrorBuilder(moduleClassName, moduleName string) ErrorBuilder { - return zErrorBuilder{ - errLocation: moduleClassName + "::" + moduleName, - pseudoErrLocation: "~" + moduleClassName + "::" + moduleName, + return errorBuilder{ + errLocation: moduleClassName + "::" + moduleName, } } -type zErrorBuilder struct { - errLocation, pseudoErrLocation string +type errorBuilder struct { + errLocation string } -type zError struct { +type wrappedError struct { error errLocation string errType ErrorType } -var _ Error = (*zError)(nil) -var _ ErrorBuilder = (*zErrorBuilder)(nil) +var _ Error = (*wrappedError)(nil) +var _ ErrorBuilder = (*errorBuilder)(nil) -func (zb zErrorBuilder) Error(err error, errType ErrorType) Error { - return zError{ +func (eb errorBuilder) Error(err error, errType ErrorType) error { + return wrappedError{ error: err, - errLocation: zb.errLocation, + errLocation: eb.errLocation, errType: errType, } } -func (zb zErrorBuilder) toError(err error) Error { - if zerr, ok := err.(Error); ok { - return zerr - } - return zError{ +func (eb errorBuilder) Rebuild(zErr Error, err error) error { + return wrappedError{ error: err, - errLocation: zb.pseudoErrLocation, + errLocation: zErr.ErrorLocation(), + errType: zErr.ErrorType(), } } -func (zb zErrorBuilder) LogFieldErrorLocation(err error) zap.Field { - zerr := zb.toError(err) - return zap.String(logFieldErrorLocation, zerr.ErrorLocation()) -} - -func (zb zErrorBuilder) LogFieldErrorType(err error) zap.Field { - zerr := zb.toError(err) - return zap.String(logFieldErrorType, zerr.ErrorType().String()) -} - -func (e zError) Unwrap() error { +func (e wrappedError) Unwrap() error { return e.error } -func (e zError) ErrorLocation() string { +func (e wrappedError) ErrorLocation() string { return e.errLocation } -func (e zError) ErrorType() ErrorType { +func (e wrappedError) ErrorType() ErrorType { return e.errType } diff --git a/runtime/error_builder_test.go b/runtime/error_builder_test.go index 1954f5588..e6d0b811e 100644 --- a/runtime/error_builder_test.go +++ b/runtime/error_builder_test.go @@ -22,50 +22,20 @@ package zanzibar_test import ( "errors" - "strconv" "testing" "github.com/stretchr/testify/assert" zanzibar "github.com/uber/zanzibar/runtime" - "go.uber.org/zap" ) func TestErrorBuilder(t *testing.T) { eb := zanzibar.NewErrorBuilder("endpoint", "foo") err := errors.New("test error") - zerr := eb.Error(err, zanzibar.TChannelError) + err2 := eb.Error(err, zanzibar.TChannelError) - assert.Equal(t, "endpoint::foo", zerr.ErrorLocation()) - assert.Equal(t, "TChannelError", zerr.ErrorType().String()) - assert.True(t, errors.Is(zerr, err)) -} - -func TestErrorBuilderLogFields(t *testing.T) { - eb := zanzibar.NewErrorBuilder("client", "bar") - testErr := errors.New("test error") - table := []struct { - err error - wantErrLocation string - wantErrType string - }{ - { - err: eb.Error(testErr, zanzibar.ClientException), - wantErrLocation: "client::bar", - wantErrType: "ClientException", - }, - { - err: testErr, - wantErrLocation: "~client::bar", - wantErrType: "ErrorType(0)", - }, - } - for i, tt := range table { - t.Run("test"+strconv.Itoa(i), func(t *testing.T) { - logFieldErrLocation := eb.LogFieldErrorLocation(tt.err) - logFieldErrType := eb.LogFieldErrorType(tt.err) - - assert.Equal(t, zap.String("errorLocation", tt.wantErrLocation), logFieldErrLocation) - assert.Equal(t, zap.String("errorType", tt.wantErrType), logFieldErrType) - }) - } + zErr, ok := err2.(zanzibar.Error) + assert.True(t, ok) + assert.Equal(t, "endpoint::foo", zErr.ErrorLocation()) + assert.Equal(t, "TChannelError", zErr.ErrorType().String()) + assert.True(t, errors.Is(err2, err)) } From 83e10debe320537e239a9dc3ceec101274d3b75c Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Wed, 28 Jun 2023 10:11:22 +0000 Subject: [PATCH 05/86] fix generated code --- codegen/template_bundle/template_files.go | 12 +- .../clients-idl/clients/bar/bar/bar.go | 2738 ++++++++--------- .../clients-idl/clients/baz/base/base.go | 224 +- .../clients-idl/clients/baz/baz/baz.go | 2250 +++++++------- .../clients/contacts/contacts/contacts.go | 354 +-- .../clients-idl/clients/corge/corge/corge.go | 386 +-- .../clients-idl/clients/echo/echo.pb.yarpc.go | 16 +- .../clients-idl/clients/foo/base/base/base.go | 32 +- .../clients-idl/clients/foo/foo/foo.go | 96 +- .../clients/googlenow/googlenow/googlenow.go | 130 +- .../clients-idl/clients/multi/multi/multi.go | 194 +- .../withexceptions/withexceptions.go | 160 +- .../endpoints/app/demo/endpoints/abc/abc.go | 64 +- .../endpoints-idl/endpoints/bar/bar/bar.go | 1426 ++++----- .../endpoints-idl/endpoints/baz/baz/baz.go | 1314 ++++---- .../endpoints/bounce/bounce/bounce.go | 64 +- .../clientless/clientless/clientless.go | 258 +- .../endpoints/contacts/contacts/contacts.go | 354 +-- .../endpoints/foo/base/base/base.go | 32 +- .../endpoints-idl/endpoints/foo/foo/foo.go | 96 +- .../googlenow/googlenow/googlenow.go | 130 +- .../endpoints/models/meta/meta.go | 224 +- .../endpoints/multi/multi/multi.go | 194 +- .../endpoints/tchannel/baz/baz/baz.go | 514 ++-- .../endpoints/tchannel/echo/echo/echo.go | 64 +- .../endpoints/tchannel/quux/quux/quux.go | 64 +- .../withexceptions/withexceptions.go | 160 +- .../build/gen-code/clients/bar/bar/bar.go | 2642 ++++++++-------- .../gen-code/clients/foo/base/base/base.go | 32 +- .../build/gen-code/clients/foo/foo/foo.go | 96 +- .../endpoints/bounce/bounce/bounce.go | 64 +- .../endpoints/tchannel/echo/echo/echo.go | 64 +- .../proto-gen/clients/echo/echo.pb.yarpc.go | 32 +- .../clients/mirror/mirror.pb.yarpc.go | 32 +- 34 files changed, 7257 insertions(+), 7255 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 15a922e60..09b111c0c 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -5022,11 +5022,13 @@ var _bindata = map[string]func() (*asset, error){ // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png +// +// data/ +// foo.txt +// img/ +// a.png +// b.png +// // then AssetDir("data") would return []string{"foo.txt", "img"} // AssetDir("data/img") would return []string{"a.png", "b.png"} // AssetDir("foo.txt") and AssetDir("notexist") would return an error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go b/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go index bda3ba24c..ccad0769e 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -781,14 +781,14 @@ type BarRequestRecur struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequestRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -828,16 +828,16 @@ func _BarRequestRecur_Read(w wire.Value) (*BarRequestRecur, error) { // An error is returned if we were unable to build a BarRequestRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequestRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequestRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequestRecur) FromWire(w wire.Value) error { var err error @@ -1132,14 +1132,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1282,16 +1282,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1994,14 +1994,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponseRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2052,16 +2052,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a BarResponseRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponseRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponseRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponseRecur) FromWire(w wire.Value) error { var err error @@ -2358,8 +2358,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -2416,10 +2416,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2436,16 +2436,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -2453,13 +2453,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2557,8 +2557,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -2615,10 +2615,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2635,16 +2635,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -2652,13 +2652,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2797,14 +2797,14 @@ type OptionalParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2832,16 +2832,16 @@ func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OptionalParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OptionalParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OptionalParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OptionalParamsStruct) FromWire(w wire.Value) error { var err error @@ -3017,14 +3017,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3050,16 +3050,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -3224,14 +3224,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -3281,16 +3281,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -3621,14 +3621,14 @@ type QueryParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -3685,16 +3685,16 @@ func (v *QueryParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -4078,14 +4078,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4127,16 +4127,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -4354,14 +4354,14 @@ type SeeOthersRedirection struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -4378,16 +4378,16 @@ func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SeeOthersRedirection struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SeeOthersRedirection -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SeeOthersRedirection +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SeeOthersRedirection) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4818,14 +4818,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4851,16 +4851,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -5129,14 +5129,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5174,16 +5174,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -5396,14 +5396,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5451,16 +5451,16 @@ func _OptionalParamsStruct_Read(w wire.Value) (*OptionalParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5842,14 +5842,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5881,16 +5881,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -6174,14 +6174,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -6464,16 +6464,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8511,14 +8511,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8550,16 +8550,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8767,14 +8767,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -8824,16 +8824,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9271,14 +9271,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9310,16 +9310,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9525,14 +9525,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9581,16 +9581,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9928,14 +9928,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9967,16 +9967,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -10182,14 +10182,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10229,16 +10229,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -10562,14 +10562,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10601,16 +10601,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -10816,14 +10816,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10865,16 +10865,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -11204,14 +11204,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11243,16 +11243,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -11457,14 +11457,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11492,16 +11492,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -11769,14 +11769,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11808,16 +11808,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -12051,14 +12051,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -12125,16 +12125,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12643,14 +12643,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12682,16 +12682,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12896,14 +12896,14 @@ type Bar_DeleteFoo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12929,16 +12929,16 @@ func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Args) FromWire(w wire.Value) error { var err error @@ -13192,14 +13192,14 @@ type Bar_DeleteFoo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13216,16 +13216,16 @@ func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13354,14 +13354,14 @@ type Bar_DeleteWithBody_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13395,16 +13395,16 @@ func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Args) FromWire(w wire.Value) error { var err error @@ -13716,14 +13716,14 @@ type Bar_DeleteWithBody_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13740,16 +13740,16 @@ func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13878,14 +13878,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13919,16 +13919,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -14240,14 +14240,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14264,16 +14264,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14400,14 +14400,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14424,16 +14424,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14666,14 +14666,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14727,16 +14727,16 @@ func _SeeOthersRedirection_Read(w wire.Value) (*SeeOthersRedirection, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -15073,14 +15073,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -15122,16 +15122,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -15537,14 +15537,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15584,16 +15584,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -15861,14 +15861,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15885,16 +15885,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -16115,14 +16115,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16162,16 +16162,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -16435,14 +16435,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -16459,16 +16459,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -16689,14 +16689,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16736,16 +16736,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -17010,14 +17010,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17046,16 +17046,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -17342,14 +17342,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17389,16 +17389,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -17663,14 +17663,14 @@ type Bar_NormalRecur_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17699,16 +17699,16 @@ func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Args) FromWire(w wire.Value) error { var err error @@ -17995,14 +17995,14 @@ type Bar_NormalRecur_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18048,16 +18048,16 @@ func _BarResponseRecur_Read(w wire.Value) (*BarResponseRecur, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Result) FromWire(w wire.Value) error { var err error @@ -18329,14 +18329,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18379,16 +18379,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -18747,14 +18747,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -18808,16 +18808,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error @@ -19148,14 +19148,14 @@ type Echo_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19184,16 +19184,16 @@ func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -19465,14 +19465,14 @@ type Echo_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19504,16 +19504,16 @@ func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -19718,14 +19718,14 @@ type Echo_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19751,16 +19751,16 @@ func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -20024,14 +20024,14 @@ type Echo_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20063,16 +20063,16 @@ func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -20281,14 +20281,14 @@ type Echo_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20314,16 +20314,16 @@ func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -20587,14 +20587,14 @@ type Echo_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20626,16 +20626,16 @@ func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -20856,14 +20856,14 @@ func Default_Echo_EchoEnum_Args() *Echo_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20895,16 +20895,16 @@ func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -21184,14 +21184,14 @@ type Echo_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21223,16 +21223,16 @@ func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -21441,14 +21441,14 @@ type Echo_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21474,16 +21474,16 @@ func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -21747,14 +21747,14 @@ type Echo_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21786,16 +21786,16 @@ func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -22004,14 +22004,14 @@ type Echo_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22037,16 +22037,16 @@ func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -22310,14 +22310,14 @@ type Echo_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22349,16 +22349,16 @@ func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -22605,14 +22605,14 @@ func (_Map_I32_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22669,16 +22669,16 @@ func _Map_I32_BarResponse_Read(m wire.MapItemList) (map[int32]*BarResponse, erro // An error is returned if we were unable to build a Echo_EchoI32Map_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Args) FromWire(w wire.Value) error { var err error @@ -23057,14 +23057,14 @@ type Echo_EchoI32Map_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23096,16 +23096,16 @@ func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32Map_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Result) FromWire(w wire.Value) error { var err error @@ -23310,14 +23310,14 @@ type Echo_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23343,16 +23343,16 @@ func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -23616,14 +23616,14 @@ type Echo_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23655,16 +23655,16 @@ func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -23873,14 +23873,14 @@ type Echo_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23906,16 +23906,16 @@ func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -24179,14 +24179,14 @@ type Echo_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24218,16 +24218,16 @@ func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -24436,14 +24436,14 @@ type Echo_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24469,16 +24469,16 @@ func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -24742,14 +24742,14 @@ type Echo_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24781,16 +24781,16 @@ func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -24999,14 +24999,14 @@ type Echo_EchoStringList_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25032,16 +25032,16 @@ func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -25310,14 +25310,14 @@ type Echo_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25349,16 +25349,16 @@ func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -25601,14 +25601,14 @@ func (_Map_String_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25665,16 +25665,16 @@ func _Map_String_BarResponse_Read(m wire.MapItemList) (map[string]*BarResponse, // An error is returned if we were unable to build a Echo_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -26040,14 +26040,14 @@ type Echo_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26079,16 +26079,16 @@ func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -26319,14 +26319,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26374,16 +26374,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -26731,14 +26731,14 @@ type Echo_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26770,16 +26770,16 @@ func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -27013,14 +27013,14 @@ func (_List_BarResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27064,16 +27064,16 @@ func _List_BarResponse_Read(l wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -27419,14 +27419,14 @@ type Echo_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27458,16 +27458,16 @@ func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -27718,14 +27718,14 @@ func (_Map_BarResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27791,16 +27791,16 @@ func _Map_BarResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a Echo_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -28237,14 +28237,14 @@ type Echo_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28276,16 +28276,16 @@ func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -28522,14 +28522,14 @@ func (_Set_BarResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28577,16 +28577,16 @@ func _Set_BarResponse_sliceType_Read(s wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -28944,14 +28944,14 @@ type Echo_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28983,16 +28983,16 @@ func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -29197,14 +29197,14 @@ type Echo_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -29230,16 +29230,16 @@ func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -29503,14 +29503,14 @@ type Echo_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -29542,16 +29542,16 @@ func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go index 595c9d0ab..b1bf4460d 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go @@ -25,14 +25,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -230,14 +230,14 @@ type NestHeaders struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestHeaders) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -271,16 +271,16 @@ func (v *NestHeaders) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestHeaders struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestHeaders -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestHeaders +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestHeaders) FromWire(w wire.Value) error { var err error @@ -508,14 +508,14 @@ type NestedStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestedStruct) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -549,16 +549,16 @@ func (v *NestedStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestedStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestedStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestedStruct) FromWire(w wire.Value) error { var err error @@ -785,14 +785,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -818,16 +818,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -1000,14 +1000,14 @@ type TransHeaders struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeaders) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1050,16 +1050,16 @@ func _Wrapped_Read(w wire.Value) (*Wrapped, error) { // An error is returned if we were unable to build a TransHeaders struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeaders -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeaders +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeaders) FromWire(w wire.Value) error { var err error @@ -1288,14 +1288,14 @@ type TransStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransStruct) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1344,16 +1344,16 @@ func _NestedStruct_Read(w wire.Value) (*NestedStruct, error) { // An error is returned if we were unable to build a TransStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransStruct) FromWire(w wire.Value) error { var err error @@ -1680,14 +1680,14 @@ type Wrapped struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Wrapped) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1730,16 +1730,16 @@ func _NestHeaders_Read(w wire.Value) (*NestHeaders, error) { // An error is returned if we were unable to build a Wrapped struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Wrapped -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Wrapped +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Wrapped) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go index 60df83835..a8c591721 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go @@ -31,14 +31,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -247,14 +247,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -294,16 +294,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -570,8 +570,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -628,10 +628,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -648,16 +648,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -665,13 +665,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -762,14 +762,14 @@ type GetProfileRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileRequest) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -801,16 +801,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a GetProfileRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileRequest) FromWire(w wire.Value) error { var err error @@ -1007,14 +1007,14 @@ func (_List_Profile_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1064,16 +1064,16 @@ func _List_Profile_Read(l wire.ValueList) ([]*Profile, error) { // An error is returned if we were unable to build a GetProfileResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileResponse) FromWire(w wire.Value) error { var err error @@ -1322,14 +1322,14 @@ type HeaderSchema struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *HeaderSchema) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1346,16 +1346,16 @@ func (v *HeaderSchema) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a HeaderSchema struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v HeaderSchema -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v HeaderSchema +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *HeaderSchema) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1465,14 +1465,14 @@ type OtherAuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OtherAuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1498,16 +1498,16 @@ func (v *OtherAuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OtherAuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OtherAuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OtherAuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OtherAuthErr) FromWire(w wire.Value) error { var err error @@ -1679,14 +1679,14 @@ type Profile struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Profile) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1721,16 +1721,16 @@ func _Recur1_Read(w wire.Value) (*Recur1, error) { // An error is returned if we were unable to build a Profile struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Profile -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Profile +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Profile) FromWire(w wire.Value) error { var err error @@ -1944,14 +1944,14 @@ func (_Map_UUID_Recur2_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2014,16 +2014,16 @@ func _Map_UUID_Recur2_Read(m wire.MapItemList) (map[UUID]*Recur2, error) { // An error is returned if we were unable to build a Recur1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur1) FromWire(w wire.Value) error { var err error @@ -2294,14 +2294,14 @@ type Recur2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur2) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2344,16 +2344,16 @@ func _Recur3_Read(w wire.Value) (*Recur3, error) { // An error is returned if we were unable to build a Recur2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur2) FromWire(w wire.Value) error { var err error @@ -2580,14 +2580,14 @@ type Recur3 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur3) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2613,16 +2613,16 @@ func (v *Recur3) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Recur3 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur3 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur3 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur3) FromWire(w wire.Value) error { var err error @@ -2838,14 +2838,14 @@ type TransHeaderType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeaderType) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -2916,16 +2916,16 @@ func (v *TransHeaderType) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TransHeaderType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeaderType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeaderType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeaderType) FromWire(w wire.Value) error { var err error @@ -3438,14 +3438,14 @@ type SecondService_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3474,16 +3474,16 @@ func (v *SecondService_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -3755,14 +3755,14 @@ type SecondService_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3794,16 +3794,16 @@ func (v *SecondService_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -4008,14 +4008,14 @@ type SecondService_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4041,16 +4041,16 @@ func (v *SecondService_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -4314,14 +4314,14 @@ type SecondService_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4353,16 +4353,16 @@ func (v *SecondService_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -4581,14 +4581,14 @@ type SecondService_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4614,16 +4614,16 @@ func (v *SecondService_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -4887,14 +4887,14 @@ type SecondService_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4926,16 +4926,16 @@ func (v *SecondService_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -5156,14 +5156,14 @@ func Default_SecondService_EchoEnum_Args() *SecondService_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5201,16 +5201,16 @@ func _Fruit_Read(w wire.Value) (Fruit, error) { // An error is returned if we were unable to build a SecondService_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -5506,14 +5506,14 @@ type SecondService_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5545,16 +5545,16 @@ func (v *SecondService_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -5763,14 +5763,14 @@ type SecondService_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5796,16 +5796,16 @@ func (v *SecondService_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -6069,14 +6069,14 @@ type SecondService_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6108,16 +6108,16 @@ func (v *SecondService_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -6336,14 +6336,14 @@ type SecondService_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6369,16 +6369,16 @@ func (v *SecondService_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -6642,14 +6642,14 @@ type SecondService_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6681,16 +6681,16 @@ func (v *SecondService_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -6899,14 +6899,14 @@ type SecondService_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6932,16 +6932,16 @@ func (v *SecondService_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -7205,14 +7205,14 @@ type SecondService_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7244,16 +7244,16 @@ func (v *SecondService_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -7472,14 +7472,14 @@ type SecondService_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7505,16 +7505,16 @@ func (v *SecondService_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -7778,14 +7778,14 @@ type SecondService_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7817,16 +7817,16 @@ func (v *SecondService_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -8045,14 +8045,14 @@ type SecondService_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8078,16 +8078,16 @@ func (v *SecondService_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -8351,14 +8351,14 @@ type SecondService_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8390,16 +8390,16 @@ func (v *SecondService_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -8644,14 +8644,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8695,16 +8695,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a SecondService_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -9047,14 +9047,14 @@ type SecondService_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9086,16 +9086,16 @@ func (v *SecondService_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -9338,14 +9338,14 @@ func (_Map_String_BazResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9408,16 +9408,16 @@ func _Map_String_BazResponse_Read(m wire.MapItemList) (map[string]*base.BazRespo // An error is returned if we were unable to build a SecondService_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -9789,14 +9789,14 @@ type SecondService_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9828,16 +9828,16 @@ func (v *SecondService_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -10068,14 +10068,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10123,16 +10123,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a SecondService_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -10480,14 +10480,14 @@ type SecondService_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10519,16 +10519,16 @@ func (v *SecondService_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -10762,14 +10762,14 @@ func (_List_BazResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10813,16 +10813,16 @@ func _List_BazResponse_Read(l wire.ValueList) ([]*base.BazResponse, error) { // An error is returned if we were unable to build a SecondService_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -11168,14 +11168,14 @@ type SecondService_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11207,16 +11207,16 @@ func (v *SecondService_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -11467,14 +11467,14 @@ func (_Map_BazResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11540,16 +11540,16 @@ func _Map_BazResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a SecondService_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -11986,14 +11986,14 @@ type SecondService_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12025,16 +12025,16 @@ func (v *SecondService_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -12271,14 +12271,14 @@ func (_Set_BazResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12326,16 +12326,16 @@ func _Set_BazResponse_sliceType_Read(s wire.ValueList) ([]*base.BazResponse, err // An error is returned if we were unable to build a SecondService_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -12693,14 +12693,14 @@ type SecondService_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12732,16 +12732,16 @@ func (v *SecondService_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -12946,14 +12946,14 @@ type SecondService_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12985,16 +12985,16 @@ func _UUID_1_Read(w wire.Value) (base.UUID, error) { // An error is returned if we were unable to build a SecondService_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -13264,14 +13264,14 @@ type SecondService_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -13303,16 +13303,16 @@ func (v *SecondService_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoTypedef_Result) FromWire(w wire.Value) error { var err error @@ -13533,14 +13533,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13591,16 +13591,16 @@ func _BazRequest_Read(w wire.Value) (*BazRequest, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -13999,14 +13999,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -14044,16 +14044,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -14266,14 +14266,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14318,16 +14318,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -14720,14 +14720,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -14759,16 +14759,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -14974,14 +14974,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15019,16 +15019,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -15387,14 +15387,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -15448,16 +15448,16 @@ func _OtherAuthErr_Read(w wire.Value) (*OtherAuthErr, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -15788,14 +15788,14 @@ type SimpleService_GetProfile_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -15830,16 +15830,16 @@ func _GetProfileRequest_Read(w wire.Value) (*GetProfileRequest, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Args) FromWire(w wire.Value) error { var err error @@ -16132,14 +16132,14 @@ type SimpleService_GetProfile_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16185,16 +16185,16 @@ func _GetProfileResponse_Read(w wire.Value) (*GetProfileResponse, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Result) FromWire(w wire.Value) error { var err error @@ -16465,14 +16465,14 @@ type SimpleService_HeaderSchema_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16507,16 +16507,16 @@ func _HeaderSchema_Read(w wire.Value) (*HeaderSchema, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Args) FromWire(w wire.Value) error { var err error @@ -16821,14 +16821,14 @@ type SimpleService_HeaderSchema_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -16876,16 +16876,16 @@ func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Result) FromWire(w wire.Value) error { var err error @@ -17209,14 +17209,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -17233,16 +17233,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -17448,14 +17448,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17487,16 +17487,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -17700,14 +17700,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -17724,16 +17724,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -17956,14 +17956,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18009,16 +18009,16 @@ func _ServerErr_Read(w wire.Value) (*base.ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error @@ -18288,14 +18288,14 @@ type SimpleService_TestUuid_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -18312,16 +18312,16 @@ func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -18517,14 +18517,14 @@ type SimpleService_TestUuid_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -18541,16 +18541,16 @@ func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -18679,14 +18679,14 @@ type SimpleService_Trans_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18729,16 +18729,16 @@ func _TransStruct_Read(w wire.Value) (*base.TransStruct, error) { // An error is returned if we were unable to build a SimpleService_Trans_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Args) FromWire(w wire.Value) error { var err error @@ -19097,14 +19097,14 @@ type SimpleService_Trans_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -19152,16 +19152,16 @@ func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Trans_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Result) FromWire(w wire.Value) error { var err error @@ -19486,14 +19486,14 @@ type SimpleService_TransHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19528,16 +19528,16 @@ func _TransHeaders_Read(w wire.Value) (*base.TransHeaders, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Args) FromWire(w wire.Value) error { var err error @@ -19842,14 +19842,14 @@ type SimpleService_TransHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -19897,16 +19897,16 @@ func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Result) FromWire(w wire.Value) error { var err error @@ -20234,14 +20234,14 @@ type SimpleService_TransHeadersNoReq_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -20299,16 +20299,16 @@ func _NestedStruct_Read(w wire.Value) (*base.NestedStruct, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Args) FromWire(w wire.Value) error { var err error @@ -20771,14 +20771,14 @@ type SimpleService_TransHeadersNoReq_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -20818,16 +20818,16 @@ func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Result) FromWire(w wire.Value) error { var err error @@ -21092,14 +21092,14 @@ type SimpleService_TransHeadersType_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21134,16 +21134,16 @@ func _TransHeaderType_Read(w wire.Value) (*TransHeaderType, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Args) FromWire(w wire.Value) error { var err error @@ -21448,14 +21448,14 @@ type SimpleService_TransHeadersType_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -21503,16 +21503,16 @@ func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Result) FromWire(w wire.Value) error { var err error @@ -21836,14 +21836,14 @@ type SimpleService_UrlTest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -21860,16 +21860,16 @@ func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -22065,14 +22065,14 @@ type SimpleService_UrlTest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -22089,16 +22089,16 @@ func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go b/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go index 41984a4b8..3671161ef 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go @@ -24,14 +24,14 @@ type BadRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BadRequest) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *BadRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BadRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BadRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BadRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BadRequest) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -207,14 +207,14 @@ func (_List_ContactFragment_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contact) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -280,16 +280,16 @@ func _ContactAttributes_Read(w wire.Value) (*ContactAttributes, error) { // An error is returned if we were unable to build a Contact struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contact -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contact +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contact) FromWire(w wire.Value) error { var err error @@ -603,14 +603,14 @@ type ContactAttributes struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactAttributes) ToWire() (wire.Value, error) { var ( fields [13]wire.Field @@ -734,16 +734,16 @@ func (v *ContactAttributes) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ContactAttributes struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactAttributes -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactAttributes) FromWire(w wire.Value) error { var err error @@ -1600,14 +1600,14 @@ type ContactFragment struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactFragment) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1649,16 +1649,16 @@ func _ContactFragmentType_Read(w wire.Value) (ContactFragmentType, error) { // An error is returned if we were unable to build a ContactFragment struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactFragment -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactFragment +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactFragment) FromWire(w wire.Value) error { var err error @@ -1942,14 +1942,14 @@ type NotFound struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotFound) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1966,16 +1966,16 @@ func (v *NotFound) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotFound struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotFound -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotFound +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotFound) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2125,14 +2125,14 @@ func (_List_Contact_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsRequest) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2189,16 +2189,16 @@ func _List_Contact_Read(l wire.ValueList) ([]*Contact, error) { // An error is returned if we were unable to build a SaveContactsRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsRequest) FromWire(w wire.Value) error { var err error @@ -2496,14 +2496,14 @@ type SaveContactsResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsResponse) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2520,16 +2520,16 @@ func (v *SaveContactsResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SaveContactsResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsResponse) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2690,14 +2690,14 @@ type Contacts_SaveContacts_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2732,16 +2732,16 @@ func _SaveContactsRequest_Read(w wire.Value) (*SaveContactsRequest, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Args) FromWire(w wire.Value) error { var err error @@ -3046,14 +3046,14 @@ type Contacts_SaveContacts_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3119,16 +3119,16 @@ func _NotFound_Read(w wire.Value) (*NotFound, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Result) FromWire(w wire.Value) error { var err error @@ -3470,14 +3470,14 @@ type Contacts_TestUrlUrl_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3494,16 +3494,16 @@ func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3709,14 +3709,14 @@ type Contacts_TestUrlUrl_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3748,16 +3748,16 @@ func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go b/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go index 5f1599bcf..11f173d5d 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go @@ -24,14 +24,14 @@ type Foo struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Foo) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *Foo) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Foo struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Foo -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Foo +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Foo) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -166,14 +166,14 @@ type NotModified struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotModified) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -190,16 +190,16 @@ func (v *NotModified) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotModified struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotModified -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotModified +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotModified) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -322,14 +322,14 @@ type Corge_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -355,16 +355,16 @@ func (v *Corge_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -628,14 +628,14 @@ type Corge_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -667,16 +667,16 @@ func (v *Corge_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -895,14 +895,14 @@ type Corge_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -928,16 +928,16 @@ func (v *Corge_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -1201,14 +1201,14 @@ type Corge_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1240,16 +1240,16 @@ func (v *Corge_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -1468,14 +1468,14 @@ type Corge_NoContent_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContent_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1501,16 +1501,16 @@ func (v *Corge_NoContent_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContent_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContent_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContent_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContent_Args) FromWire(w wire.Value) error { var err error @@ -1779,14 +1779,14 @@ type Corge_NoContent_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContent_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1824,16 +1824,16 @@ func _NotModified_Read(w wire.Value) (*NotModified, error) { // An error is returned if we were unable to build a Corge_NoContent_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContent_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContent_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContent_Result) FromWire(w wire.Value) error { var err error @@ -2044,14 +2044,14 @@ type Corge_NoContentNoException_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentNoException_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2077,16 +2077,16 @@ func (v *Corge_NoContentNoException_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentNoException_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentNoException_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentNoException_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentNoException_Args) FromWire(w wire.Value) error { var err error @@ -2340,14 +2340,14 @@ type Corge_NoContentNoException_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentNoException_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2364,16 +2364,16 @@ func (v *Corge_NoContentNoException_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentNoException_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentNoException_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentNoException_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentNoException_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2501,14 +2501,14 @@ type Corge_NoContentOnException_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentOnException_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2534,16 +2534,16 @@ func (v *Corge_NoContentOnException_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentOnException_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentOnException_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentOnException_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentOnException_Args) FromWire(w wire.Value) error { var err error @@ -2822,14 +2822,14 @@ type Corge_NoContentOnException_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentOnException_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2875,16 +2875,16 @@ func _Foo_Read(w wire.Value) (*Foo, error) { // An error is returned if we were unable to build a Corge_NoContentOnException_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentOnException_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentOnException_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentOnException_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go b/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go index 5fcf5f61d..ac9418fe6 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go @@ -107,10 +107,10 @@ type FxEchoYARPCClientResult struct { // NewFxEchoYARPCClient provides a EchoYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCClient("service-name"), +// ... +// ) func NewFxEchoYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoYARPCClientParams) FxEchoYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxEchoYARPCProceduresResult struct { // NewFxEchoYARPCProcedures provides EchoYARPCServer procedures to an Fx application. // It expects a EchoYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCProcedures(), +// ... +// ) func NewFxEchoYARPCProcedures() interface{} { return func(params FxEchoYARPCProceduresParams) FxEchoYARPCProceduresResult { return FxEchoYARPCProceduresResult{ diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go index 6a6319ad1..b53de2e66 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go index 1dc2efe9d..952c40476 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go b/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go index b5d3d057a..90f9d62d5 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go @@ -27,14 +27,14 @@ type GoogleNowService_AddCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_AddCredentials_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *GoogleNowService_AddCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_AddCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_AddCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_AddCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_AddCredentials_Args) FromWire(w wire.Value) error { var err error @@ -323,14 +323,14 @@ type GoogleNowService_AddCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_AddCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -347,16 +347,16 @@ func (v *GoogleNowService_AddCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_AddCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_AddCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_AddCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_AddCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -483,14 +483,14 @@ type GoogleNowService_CheckCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_CheckCredentials_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -507,16 +507,16 @@ func (v *GoogleNowService_CheckCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_CheckCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_CheckCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_CheckCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_CheckCredentials_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -712,14 +712,14 @@ type GoogleNowService_CheckCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_CheckCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -736,16 +736,16 @@ func (v *GoogleNowService_CheckCredentials_Result) ToWire() (wire.Value, error) // An error is returned if we were unable to build a GoogleNowService_CheckCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_CheckCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_CheckCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_CheckCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go b/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go index 669caf5c0..3cc22c40a 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go @@ -26,14 +26,14 @@ type ServiceABack_HelloA_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceABack_HelloA_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *ServiceABack_HelloA_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceABack_HelloA_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceABack_HelloA_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceABack_HelloA_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceABack_HelloA_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type ServiceABack_HelloA_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceABack_HelloA_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *ServiceABack_HelloA_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceABack_HelloA_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceABack_HelloA_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceABack_HelloA_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceABack_HelloA_Result) FromWire(w wire.Value) error { var err error @@ -531,14 +531,14 @@ type ServiceBBack_HelloB_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBBack_HelloB_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -555,16 +555,16 @@ func (v *ServiceBBack_HelloB_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBBack_HelloB_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBBack_HelloB_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBBack_HelloB_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBBack_HelloB_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -770,14 +770,14 @@ type ServiceBBack_HelloB_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBBack_HelloB_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -809,16 +809,16 @@ func (v *ServiceBBack_HelloB_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBBack_HelloB_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBBack_HelloB_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBBack_HelloB_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBBack_HelloB_Result) FromWire(w wire.Value) error { var err error @@ -1026,14 +1026,14 @@ type ServiceCBack_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCBack_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1050,16 +1050,16 @@ func (v *ServiceCBack_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCBack_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCBack_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCBack_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCBack_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1265,14 +1265,14 @@ type ServiceCBack_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCBack_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1304,16 +1304,16 @@ func (v *ServiceCBack_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCBack_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCBack_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCBack_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCBack_Hello_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go b/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go index c93f1aa61..9bf9bc20f 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go @@ -25,14 +25,14 @@ type ExceptionType1 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ExceptionType1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *ExceptionType1) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ExceptionType1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ExceptionType1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ExceptionType1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ExceptionType1) FromWire(w wire.Value) error { var err error @@ -239,14 +239,14 @@ type ExceptionType2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ExceptionType2) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -272,16 +272,16 @@ func (v *ExceptionType2) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ExceptionType2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ExceptionType2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ExceptionType2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ExceptionType2) FromWire(w wire.Value) error { var err error @@ -452,14 +452,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -476,16 +476,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -597,14 +597,14 @@ type WithExceptions_Func1_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -621,16 +621,16 @@ func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -863,14 +863,14 @@ type WithExceptions_Func1_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -936,16 +936,16 @@ func _ExceptionType2_Read(w wire.Value) (*ExceptionType2, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go index f113f39ce..d92699ddb 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go @@ -26,14 +26,14 @@ type AppDemoService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AppDemoService_Call_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *AppDemoService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AppDemoService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AppDemoService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AppDemoService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AppDemoService_Call_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type AppDemoService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AppDemoService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *AppDemoService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AppDemoService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AppDemoService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AppDemoService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AppDemoService_Call_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go index b1186bbfd..32e9119c1 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -856,14 +856,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1006,16 +1006,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1698,8 +1698,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -1756,10 +1756,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -1776,16 +1776,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -1793,13 +1793,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -1897,8 +1897,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -1955,10 +1955,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -1975,16 +1975,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -1992,13 +1992,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2137,14 +2137,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2170,16 +2170,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -2344,14 +2344,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -2401,16 +2401,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -2777,14 +2777,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -2859,16 +2859,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -3326,14 +3326,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -3375,16 +3375,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -3602,14 +3602,14 @@ type SeeOthersRedirection struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3626,16 +3626,16 @@ func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SeeOthersRedirection struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SeeOthersRedirection -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SeeOthersRedirection +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SeeOthersRedirection) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4066,14 +4066,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4099,16 +4099,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -4377,14 +4377,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4422,16 +4422,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -4643,14 +4643,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4684,16 +4684,16 @@ func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5015,14 +5015,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5054,16 +5054,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -5347,14 +5347,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -5637,16 +5637,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -7684,14 +7684,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7723,16 +7723,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -7940,14 +7940,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -7997,16 +7997,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8444,14 +8444,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8483,16 +8483,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8698,14 +8698,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -8754,16 +8754,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9101,14 +9101,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9140,16 +9140,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9355,14 +9355,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9402,16 +9402,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -9735,14 +9735,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9774,16 +9774,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -9989,14 +9989,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10038,16 +10038,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -10377,14 +10377,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10416,16 +10416,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -10630,14 +10630,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10665,16 +10665,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -10942,14 +10942,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10981,16 +10981,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -11224,14 +11224,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -11298,16 +11298,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -11816,14 +11816,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11855,16 +11855,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12070,14 +12070,14 @@ type Bar_DeleteWithBody_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -12111,16 +12111,16 @@ func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Args) FromWire(w wire.Value) error { var err error @@ -12432,14 +12432,14 @@ type Bar_DeleteWithBody_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12456,16 +12456,16 @@ func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -12594,14 +12594,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -12635,16 +12635,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12956,14 +12956,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12980,16 +12980,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13116,14 +13116,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13140,16 +13140,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13382,14 +13382,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13443,16 +13443,16 @@ func _SeeOthersRedirection_Read(w wire.Value) (*SeeOthersRedirection, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -13789,14 +13789,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13838,16 +13838,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -14253,14 +14253,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14300,16 +14300,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -14577,14 +14577,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14601,16 +14601,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14831,14 +14831,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14878,16 +14878,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -15151,14 +15151,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15175,16 +15175,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15405,14 +15405,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15452,16 +15452,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -15726,14 +15726,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -15762,16 +15762,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -16058,14 +16058,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16105,16 +16105,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -16380,14 +16380,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16430,16 +16430,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -16798,14 +16798,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -16859,16 +16859,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go index 936aeb2b6..7f8322101 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go @@ -25,14 +25,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -241,14 +241,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -288,16 +288,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -557,14 +557,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -590,16 +590,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -761,14 +761,14 @@ type GetProfileRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileRequest) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -800,16 +800,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a GetProfileRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileRequest) FromWire(w wire.Value) error { var err error @@ -1006,14 +1006,14 @@ func (_List_Profile_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1063,16 +1063,16 @@ func _List_Profile_Read(l wire.ValueList) ([]*Profile, error) { // An error is returned if we were unable to build a GetProfileResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileResponse) FromWire(w wire.Value) error { var err error @@ -1321,14 +1321,14 @@ type HeaderSchema struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *HeaderSchema) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1345,16 +1345,16 @@ func (v *HeaderSchema) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a HeaderSchema struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v HeaderSchema -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v HeaderSchema +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *HeaderSchema) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1465,14 +1465,14 @@ type NestedStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestedStruct) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1506,16 +1506,16 @@ func (v *NestedStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestedStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestedStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestedStruct) FromWire(w wire.Value) error { var err error @@ -1742,14 +1742,14 @@ type OtherAuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OtherAuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1775,16 +1775,16 @@ func (v *OtherAuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OtherAuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OtherAuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OtherAuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OtherAuthErr) FromWire(w wire.Value) error { var err error @@ -1956,14 +1956,14 @@ type Profile struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Profile) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1998,16 +1998,16 @@ func _Recur1_Read(w wire.Value) (*Recur1, error) { // An error is returned if we were unable to build a Profile struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Profile -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Profile +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Profile) FromWire(w wire.Value) error { var err error @@ -2221,14 +2221,14 @@ func (_Map_UUID_Recur2_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2291,16 +2291,16 @@ func _Map_UUID_Recur2_Read(m wire.MapItemList) (map[UUID]*Recur2, error) { // An error is returned if we were unable to build a Recur1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur1) FromWire(w wire.Value) error { var err error @@ -2571,14 +2571,14 @@ type Recur2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur2) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2622,16 +2622,16 @@ func _Recur3_Read(w wire.Value) (*Recur3, error) { // An error is returned if we were unable to build a Recur2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur2) FromWire(w wire.Value) error { var err error @@ -2864,14 +2864,14 @@ type Recur3 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur3) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2897,16 +2897,16 @@ func (v *Recur3) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Recur3 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur3 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur3 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur3) FromWire(w wire.Value) error { var err error @@ -3068,14 +3068,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3101,16 +3101,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -3281,14 +3281,14 @@ type TransHeader struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeader) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3305,16 +3305,16 @@ func (v *TransHeader) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TransHeader struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeader -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeader +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeader) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3426,14 +3426,14 @@ type TransStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransStruct) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3482,16 +3482,16 @@ func _NestedStruct_Read(w wire.Value) (*NestedStruct, error) { // An error is returned if we were unable to build a TransStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransStruct) FromWire(w wire.Value) error { var err error @@ -3822,14 +3822,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3880,16 +3880,16 @@ func _BazRequest_Read(w wire.Value) (*BazRequest, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -4308,14 +4308,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4353,16 +4353,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -4575,14 +4575,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -4627,16 +4627,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -5029,14 +5029,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5068,16 +5068,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -5283,14 +5283,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -5328,16 +5328,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -5696,14 +5696,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5763,16 +5763,16 @@ func _OtherAuthErr_Read(w wire.Value) (*OtherAuthErr, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -6109,14 +6109,14 @@ type SimpleService_GetProfile_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6151,16 +6151,16 @@ func _GetProfileRequest_Read(w wire.Value) (*GetProfileRequest, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Args) FromWire(w wire.Value) error { var err error @@ -6453,14 +6453,14 @@ type SimpleService_GetProfile_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -6506,16 +6506,16 @@ func _GetProfileResponse_Read(w wire.Value) (*GetProfileResponse, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Result) FromWire(w wire.Value) error { var err error @@ -6786,14 +6786,14 @@ type SimpleService_HeaderSchema_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6828,16 +6828,16 @@ func _HeaderSchema_Read(w wire.Value) (*HeaderSchema, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Args) FromWire(w wire.Value) error { var err error @@ -7142,14 +7142,14 @@ type SimpleService_HeaderSchema_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -7197,16 +7197,16 @@ func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Result) FromWire(w wire.Value) error { var err error @@ -7530,14 +7530,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -7554,16 +7554,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -7769,14 +7769,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7808,16 +7808,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -8021,14 +8021,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8045,16 +8045,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -8277,14 +8277,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -8330,16 +8330,16 @@ func _ServerErr_Read(w wire.Value) (*ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error @@ -8609,14 +8609,14 @@ type SimpleService_TestUuid_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8633,16 +8633,16 @@ func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -8838,14 +8838,14 @@ type SimpleService_TestUuid_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8862,16 +8862,16 @@ func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -9000,14 +9000,14 @@ type SimpleService_Trans_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9050,16 +9050,16 @@ func _TransStruct_Read(w wire.Value) (*TransStruct, error) { // An error is returned if we were unable to build a SimpleService_Trans_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Args) FromWire(w wire.Value) error { var err error @@ -9418,14 +9418,14 @@ type SimpleService_Trans_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -9473,16 +9473,16 @@ func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Trans_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Result) FromWire(w wire.Value) error { var err error @@ -9807,14 +9807,14 @@ type SimpleService_TransHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9849,16 +9849,16 @@ func _TransHeader_Read(w wire.Value) (*TransHeader, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Args) FromWire(w wire.Value) error { var err error @@ -10163,14 +10163,14 @@ type SimpleService_TransHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -10218,16 +10218,16 @@ func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Result) FromWire(w wire.Value) error { var err error @@ -10551,14 +10551,14 @@ type SimpleService_TransHeadersNoReq_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -10575,16 +10575,16 @@ func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -10805,14 +10805,14 @@ type SimpleService_TransHeadersNoReq_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10852,16 +10852,16 @@ func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Result) FromWire(w wire.Value) error { var err error @@ -11126,14 +11126,14 @@ type SimpleService_TransHeadersType_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11162,16 +11162,16 @@ func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Args) FromWire(w wire.Value) error { var err error @@ -11470,14 +11470,14 @@ type SimpleService_TransHeadersType_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -11525,16 +11525,16 @@ func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Result) FromWire(w wire.Value) error { var err error @@ -11858,14 +11858,14 @@ type SimpleService_UrlTest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -11882,16 +11882,16 @@ func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -12087,14 +12087,14 @@ type SimpleService_UrlTest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12111,16 +12111,16 @@ func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go index 2196bf6a4..109ea1040 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go @@ -27,14 +27,14 @@ type Bounce_Bounce_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Bounce_Bounce_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go index 78d51e070..b63d2761f 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go @@ -26,14 +26,14 @@ type Request struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Request) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -69,16 +69,16 @@ func (v *Request) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Request struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Request -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Request +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Request) FromWire(w wire.Value) error { var err error @@ -310,14 +310,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -353,16 +353,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { var err error @@ -587,14 +587,14 @@ type Clientless_Beta_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_Beta_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -636,16 +636,16 @@ func _Request_Read(w wire.Value) (*Request, error) { // An error is returned if we were unable to build a Clientless_Beta_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_Beta_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_Beta_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_Beta_Args) FromWire(w wire.Value) error { var err error @@ -973,14 +973,14 @@ type Clientless_Beta_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_Beta_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1018,16 +1018,16 @@ func _Response_Read(w wire.Value) (*Response, error) { // An error is returned if we were unable to build a Clientless_Beta_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_Beta_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_Beta_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_Beta_Result) FromWire(w wire.Value) error { var err error @@ -1239,14 +1239,14 @@ type Clientless_ClientlessArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_ClientlessArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1280,16 +1280,16 @@ func (v *Clientless_ClientlessArgWithHeaders_Args) ToWire() (wire.Value, error) // An error is returned if we were unable to build a Clientless_ClientlessArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_ClientlessArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_ClientlessArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_ClientlessArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -1611,14 +1611,14 @@ type Clientless_ClientlessArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_ClientlessArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1650,16 +1650,16 @@ func (v *Clientless_ClientlessArgWithHeaders_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Clientless_ClientlessArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_ClientlessArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_ClientlessArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_ClientlessArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -1864,14 +1864,14 @@ type Clientless_EmptyclientlessRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_EmptyclientlessRequest_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1899,16 +1899,16 @@ func (v *Clientless_EmptyclientlessRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Clientless_EmptyclientlessRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_EmptyclientlessRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_EmptyclientlessRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_EmptyclientlessRequest_Args) FromWire(w wire.Value) error { var err error @@ -2166,14 +2166,14 @@ type Clientless_EmptyclientlessRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_EmptyclientlessRequest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2190,16 +2190,16 @@ func (v *Clientless_EmptyclientlessRequest_Result) ToWire() (wire.Value, error) // An error is returned if we were unable to build a Clientless_EmptyclientlessRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_EmptyclientlessRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_EmptyclientlessRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_EmptyclientlessRequest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go index 41984a4b8..3671161ef 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go @@ -24,14 +24,14 @@ type BadRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BadRequest) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *BadRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BadRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BadRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BadRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BadRequest) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -207,14 +207,14 @@ func (_List_ContactFragment_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contact) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -280,16 +280,16 @@ func _ContactAttributes_Read(w wire.Value) (*ContactAttributes, error) { // An error is returned if we were unable to build a Contact struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contact -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contact +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contact) FromWire(w wire.Value) error { var err error @@ -603,14 +603,14 @@ type ContactAttributes struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactAttributes) ToWire() (wire.Value, error) { var ( fields [13]wire.Field @@ -734,16 +734,16 @@ func (v *ContactAttributes) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ContactAttributes struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactAttributes -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactAttributes) FromWire(w wire.Value) error { var err error @@ -1600,14 +1600,14 @@ type ContactFragment struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactFragment) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1649,16 +1649,16 @@ func _ContactFragmentType_Read(w wire.Value) (ContactFragmentType, error) { // An error is returned if we were unable to build a ContactFragment struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactFragment -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactFragment +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactFragment) FromWire(w wire.Value) error { var err error @@ -1942,14 +1942,14 @@ type NotFound struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotFound) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1966,16 +1966,16 @@ func (v *NotFound) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotFound struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotFound -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotFound +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotFound) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2125,14 +2125,14 @@ func (_List_Contact_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsRequest) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2189,16 +2189,16 @@ func _List_Contact_Read(l wire.ValueList) ([]*Contact, error) { // An error is returned if we were unable to build a SaveContactsRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsRequest) FromWire(w wire.Value) error { var err error @@ -2496,14 +2496,14 @@ type SaveContactsResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsResponse) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2520,16 +2520,16 @@ func (v *SaveContactsResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SaveContactsResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsResponse) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2690,14 +2690,14 @@ type Contacts_SaveContacts_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2732,16 +2732,16 @@ func _SaveContactsRequest_Read(w wire.Value) (*SaveContactsRequest, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Args) FromWire(w wire.Value) error { var err error @@ -3046,14 +3046,14 @@ type Contacts_SaveContacts_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3119,16 +3119,16 @@ func _NotFound_Read(w wire.Value) (*NotFound, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Result) FromWire(w wire.Value) error { var err error @@ -3470,14 +3470,14 @@ type Contacts_TestUrlUrl_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3494,16 +3494,16 @@ func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3709,14 +3709,14 @@ type Contacts_TestUrlUrl_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3748,16 +3748,16 @@ func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go index 6a6319ad1..b53de2e66 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go index 2fe5c0dfc..c5c2ee49d 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go index 83aa729bd..5159ffae5 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go @@ -27,14 +27,14 @@ type GoogleNow_AddCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_AddCredentials_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *GoogleNow_AddCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_AddCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_AddCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_AddCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_AddCredentials_Args) FromWire(w wire.Value) error { var err error @@ -323,14 +323,14 @@ type GoogleNow_AddCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_AddCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -347,16 +347,16 @@ func (v *GoogleNow_AddCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_AddCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_AddCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_AddCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_AddCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -483,14 +483,14 @@ type GoogleNow_CheckCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_CheckCredentials_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -507,16 +507,16 @@ func (v *GoogleNow_CheckCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_CheckCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_CheckCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_CheckCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_CheckCredentials_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -712,14 +712,14 @@ type GoogleNow_CheckCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_CheckCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -736,16 +736,16 @@ func (v *GoogleNow_CheckCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_CheckCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_CheckCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_CheckCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_CheckCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go index 0c5f9cfa0..65ebdf150 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go @@ -26,14 +26,14 @@ type Dgx struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Dgx) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -74,16 +74,16 @@ func (v *Dgx) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Dgx struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Dgx -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Dgx +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Dgx) FromWire(w wire.Value) error { var err error @@ -360,14 +360,14 @@ type Fred struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Fred) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -400,16 +400,16 @@ func (v *Fred) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Fred struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Fred -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Fred +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Fred) FromWire(w wire.Value) error { var err error @@ -621,14 +621,14 @@ type Garply struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Garply) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -664,16 +664,16 @@ func (v *Garply) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Garply struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Garply -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Garply +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Garply) FromWire(w wire.Value) error { var err error @@ -905,14 +905,14 @@ type Grault struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Grault) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -948,16 +948,16 @@ func (v *Grault) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Grault struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Grault -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Grault +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Grault) FromWire(w wire.Value) error { var err error @@ -1178,14 +1178,14 @@ type Thud struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Thud) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1213,16 +1213,16 @@ func (v *Thud) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Thud struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Thud -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Thud +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Thud) FromWire(w wire.Value) error { var err error @@ -1388,14 +1388,14 @@ type TokenOnly struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TokenOnly) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1421,16 +1421,16 @@ func (v *TokenOnly) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TokenOnly struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TokenOnly -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TokenOnly +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TokenOnly) FromWire(w wire.Value) error { var err error @@ -1592,14 +1592,14 @@ type UUIDOnly struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *UUIDOnly) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1625,16 +1625,16 @@ func (v *UUIDOnly) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a UUIDOnly struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v UUIDOnly -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v UUIDOnly +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *UUIDOnly) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go index 0eb0fd252..d8a9090d3 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go @@ -26,14 +26,14 @@ type ServiceAFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceAFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *ServiceAFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceAFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceAFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceAFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceAFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type ServiceAFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceAFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *ServiceAFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceAFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceAFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceAFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceAFront_Hello_Result) FromWire(w wire.Value) error { var err error @@ -531,14 +531,14 @@ type ServiceBFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -555,16 +555,16 @@ func (v *ServiceBFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -770,14 +770,14 @@ type ServiceBFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -809,16 +809,16 @@ func (v *ServiceBFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBFront_Hello_Result) FromWire(w wire.Value) error { var err error @@ -1026,14 +1026,14 @@ type ServiceCFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1050,16 +1050,16 @@ func (v *ServiceCFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1265,14 +1265,14 @@ type ServiceCFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1304,16 +1304,16 @@ func (v *ServiceCFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCFront_Hello_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go index 9ce0e679b..57d2e4fb5 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go @@ -25,14 +25,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -241,14 +241,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -288,16 +288,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -557,14 +557,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -590,16 +590,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -761,14 +761,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -794,16 +794,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -1028,14 +1028,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1092,16 +1092,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -1526,14 +1526,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1571,16 +1571,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -1793,14 +1793,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1845,16 +1845,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -2247,14 +2247,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2286,16 +2286,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -2501,14 +2501,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2546,16 +2546,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -2902,14 +2902,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2955,16 +2955,16 @@ func _BazResponse_Read(w wire.Value) (*BazResponse, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -3235,14 +3235,14 @@ type SimpleService_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3268,16 +3268,16 @@ func (v *SimpleService_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Echo_Args) FromWire(w wire.Value) error { var err error @@ -3541,14 +3541,14 @@ type SimpleService_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3580,16 +3580,16 @@ func (v *SimpleService_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Echo_Result) FromWire(w wire.Value) error { var err error @@ -3807,14 +3807,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3831,16 +3831,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4046,14 +4046,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4085,16 +4085,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -4298,14 +4298,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -4322,16 +4322,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4554,14 +4554,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4607,16 +4607,16 @@ func _ServerErr_Read(w wire.Value) (*ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go index ef55415d0..25f07523a 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go @@ -27,14 +27,14 @@ type Echo_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Echo_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go index 2e2a734a4..ebc47b003 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go @@ -27,14 +27,14 @@ type SimpleService_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *SimpleService_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type SimpleService_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *SimpleService_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_EchoString_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go index e660a22bb..22430fa22 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go @@ -25,14 +25,14 @@ type EndpointExceptionType1 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *EndpointExceptionType1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *EndpointExceptionType1) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a EndpointExceptionType1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v EndpointExceptionType1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v EndpointExceptionType1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *EndpointExceptionType1) FromWire(w wire.Value) error { var err error @@ -239,14 +239,14 @@ type EndpointExceptionType2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *EndpointExceptionType2) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -272,16 +272,16 @@ func (v *EndpointExceptionType2) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a EndpointExceptionType2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v EndpointExceptionType2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v EndpointExceptionType2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *EndpointExceptionType2) FromWire(w wire.Value) error { var err error @@ -452,14 +452,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -476,16 +476,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -597,14 +597,14 @@ type WithExceptions_Func1_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -621,16 +621,16 @@ func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -863,14 +863,14 @@ type WithExceptions_Func1_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -936,16 +936,16 @@ func _EndpointExceptionType2_Read(w wire.Value) (*EndpointExceptionType2, error) // An error is returned if we were unable to build a WithExceptions_Func1_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go b/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go index 4fff33491..58e436a48 100644 --- a/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go +++ b/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -781,14 +781,14 @@ type BarRequestRecur struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequestRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -828,16 +828,16 @@ func _BarRequestRecur_Read(w wire.Value) (*BarRequestRecur, error) { // An error is returned if we were unable to build a BarRequestRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequestRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequestRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequestRecur) FromWire(w wire.Value) error { var err error @@ -1132,14 +1132,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1282,16 +1282,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1994,14 +1994,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponseRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2052,16 +2052,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a BarResponseRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponseRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponseRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponseRecur) FromWire(w wire.Value) error { var err error @@ -2358,8 +2358,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -2416,10 +2416,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2436,16 +2436,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -2453,13 +2453,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2557,8 +2557,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -2615,10 +2615,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2635,16 +2635,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -2652,13 +2652,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2797,14 +2797,14 @@ type OptionalParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2832,16 +2832,16 @@ func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OptionalParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OptionalParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OptionalParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OptionalParamsStruct) FromWire(w wire.Value) error { var err error @@ -3017,14 +3017,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3050,16 +3050,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -3224,14 +3224,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -3281,16 +3281,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -3621,14 +3621,14 @@ type QueryParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -3685,16 +3685,16 @@ func (v *QueryParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -4078,14 +4078,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4127,16 +4127,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -4666,14 +4666,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4699,16 +4699,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -4977,14 +4977,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5022,16 +5022,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -5244,14 +5244,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5299,16 +5299,16 @@ func _OptionalParamsStruct_Read(w wire.Value) (*OptionalParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5690,14 +5690,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5729,16 +5729,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -6022,14 +6022,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -6312,16 +6312,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8359,14 +8359,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8398,16 +8398,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8615,14 +8615,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -8672,16 +8672,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9119,14 +9119,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9158,16 +9158,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9373,14 +9373,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9429,16 +9429,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9776,14 +9776,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9815,16 +9815,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -10030,14 +10030,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10077,16 +10077,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -10410,14 +10410,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10449,16 +10449,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -10664,14 +10664,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10713,16 +10713,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -11052,14 +11052,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11091,16 +11091,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -11305,14 +11305,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11340,16 +11340,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -11617,14 +11617,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11656,16 +11656,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -11899,14 +11899,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -11973,16 +11973,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12491,14 +12491,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12530,16 +12530,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12744,14 +12744,14 @@ type Bar_DeleteFoo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12777,16 +12777,16 @@ func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Args) FromWire(w wire.Value) error { var err error @@ -13040,14 +13040,14 @@ type Bar_DeleteFoo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13064,16 +13064,16 @@ func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13202,14 +13202,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13243,16 +13243,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -13564,14 +13564,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13588,16 +13588,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13724,14 +13724,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13748,16 +13748,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13978,14 +13978,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14025,16 +14025,16 @@ func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -14305,14 +14305,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14354,16 +14354,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -14769,14 +14769,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14816,16 +14816,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -15093,14 +15093,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15117,16 +15117,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15347,14 +15347,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15394,16 +15394,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -15667,14 +15667,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15691,16 +15691,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15921,14 +15921,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15968,16 +15968,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -16242,14 +16242,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16278,16 +16278,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -16574,14 +16574,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16621,16 +16621,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -16895,14 +16895,14 @@ type Bar_NormalRecur_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16931,16 +16931,16 @@ func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Args) FromWire(w wire.Value) error { var err error @@ -17227,14 +17227,14 @@ type Bar_NormalRecur_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17280,16 +17280,16 @@ func _BarResponseRecur_Read(w wire.Value) (*BarResponseRecur, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Result) FromWire(w wire.Value) error { var err error @@ -17561,14 +17561,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17611,16 +17611,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -17979,14 +17979,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -18040,16 +18040,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error @@ -18380,14 +18380,14 @@ type Echo_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18416,16 +18416,16 @@ func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -18697,14 +18697,14 @@ type Echo_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18736,16 +18736,16 @@ func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -18950,14 +18950,14 @@ type Echo_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18983,16 +18983,16 @@ func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -19256,14 +19256,14 @@ type Echo_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19295,16 +19295,16 @@ func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -19513,14 +19513,14 @@ type Echo_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19546,16 +19546,16 @@ func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -19819,14 +19819,14 @@ type Echo_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19858,16 +19858,16 @@ func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -20088,14 +20088,14 @@ func Default_Echo_EchoEnum_Args() *Echo_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20127,16 +20127,16 @@ func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -20416,14 +20416,14 @@ type Echo_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20455,16 +20455,16 @@ func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -20673,14 +20673,14 @@ type Echo_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20706,16 +20706,16 @@ func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -20979,14 +20979,14 @@ type Echo_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21018,16 +21018,16 @@ func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -21236,14 +21236,14 @@ type Echo_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21269,16 +21269,16 @@ func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -21542,14 +21542,14 @@ type Echo_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21581,16 +21581,16 @@ func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -21837,14 +21837,14 @@ func (_Map_I32_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21901,16 +21901,16 @@ func _Map_I32_BarResponse_Read(m wire.MapItemList) (map[int32]*BarResponse, erro // An error is returned if we were unable to build a Echo_EchoI32Map_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Args) FromWire(w wire.Value) error { var err error @@ -22289,14 +22289,14 @@ type Echo_EchoI32Map_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22328,16 +22328,16 @@ func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32Map_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Result) FromWire(w wire.Value) error { var err error @@ -22542,14 +22542,14 @@ type Echo_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22575,16 +22575,16 @@ func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -22848,14 +22848,14 @@ type Echo_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22887,16 +22887,16 @@ func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -23105,14 +23105,14 @@ type Echo_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23138,16 +23138,16 @@ func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -23411,14 +23411,14 @@ type Echo_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23450,16 +23450,16 @@ func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -23668,14 +23668,14 @@ type Echo_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23701,16 +23701,16 @@ func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -23974,14 +23974,14 @@ type Echo_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24013,16 +24013,16 @@ func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -24231,14 +24231,14 @@ type Echo_EchoStringList_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24264,16 +24264,16 @@ func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -24542,14 +24542,14 @@ type Echo_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24581,16 +24581,16 @@ func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -24833,14 +24833,14 @@ func (_Map_String_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24897,16 +24897,16 @@ func _Map_String_BarResponse_Read(m wire.MapItemList) (map[string]*BarResponse, // An error is returned if we were unable to build a Echo_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -25272,14 +25272,14 @@ type Echo_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25311,16 +25311,16 @@ func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -25551,14 +25551,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25606,16 +25606,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -25963,14 +25963,14 @@ type Echo_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26002,16 +26002,16 @@ func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -26245,14 +26245,14 @@ func (_List_BarResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26296,16 +26296,16 @@ func _List_BarResponse_Read(l wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -26651,14 +26651,14 @@ type Echo_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26690,16 +26690,16 @@ func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -26950,14 +26950,14 @@ func (_Map_BarResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27023,16 +27023,16 @@ func _Map_BarResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a Echo_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -27469,14 +27469,14 @@ type Echo_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27508,16 +27508,16 @@ func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -27754,14 +27754,14 @@ func (_Set_BarResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27809,16 +27809,16 @@ func _Set_BarResponse_sliceType_Read(s wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -28176,14 +28176,14 @@ type Echo_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28215,16 +28215,16 @@ func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -28429,14 +28429,14 @@ type Echo_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28462,16 +28462,16 @@ func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -28735,14 +28735,14 @@ type Echo_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28774,16 +28774,16 @@ func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go b/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go index 6a6319ad1..b53de2e66 100644 --- a/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go +++ b/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go b/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go index 94b7ce514..6136ddb2d 100644 --- a/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go +++ b/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go b/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go index 2196bf6a4..109ea1040 100644 --- a/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go +++ b/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go @@ -27,14 +27,14 @@ type Bounce_Bounce_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Bounce_Bounce_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go b/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go index ef55415d0..25f07523a 100644 --- a/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go +++ b/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go @@ -27,14 +27,14 @@ type Echo_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Echo_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go b/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go index 7a5e6f298..8b2da3861 100644 --- a/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go +++ b/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go @@ -107,10 +107,10 @@ type FxEchoYARPCClientResult struct { // NewFxEchoYARPCClient provides a EchoYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCClient("service-name"), +// ... +// ) func NewFxEchoYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoYARPCClientParams) FxEchoYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxEchoYARPCProceduresResult struct { // NewFxEchoYARPCProcedures provides EchoYARPCServer procedures to an Fx application. // It expects a EchoYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCProcedures(), +// ... +// ) func NewFxEchoYARPCProcedures() interface{} { return func(params FxEchoYARPCProceduresParams) FxEchoYARPCProceduresResult { return FxEchoYARPCProceduresResult{ @@ -311,10 +311,10 @@ type FxEchoInternalYARPCClientResult struct { // NewFxEchoInternalYARPCClient provides a EchoInternalYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoInternalYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoInternalYARPCClient("service-name"), +// ... +// ) func NewFxEchoInternalYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoInternalYARPCClientParams) FxEchoInternalYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -360,10 +360,10 @@ type FxEchoInternalYARPCProceduresResult struct { // NewFxEchoInternalYARPCProcedures provides EchoInternalYARPCServer procedures to an Fx application. // It expects a EchoInternalYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoInternalYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoInternalYARPCProcedures(), +// ... +// ) func NewFxEchoInternalYARPCProcedures() interface{} { return func(params FxEchoInternalYARPCProceduresParams) FxEchoInternalYARPCProceduresResult { return FxEchoInternalYARPCProceduresResult{ diff --git a/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go b/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go index cee0d9f40..20f065baa 100644 --- a/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go +++ b/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go @@ -107,10 +107,10 @@ type FxMirrorYARPCClientResult struct { // NewFxMirrorYARPCClient provides a MirrorYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// mirror.NewFxMirrorYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorYARPCClient("service-name"), +// ... +// ) func NewFxMirrorYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxMirrorYARPCClientParams) FxMirrorYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxMirrorYARPCProceduresResult struct { // NewFxMirrorYARPCProcedures provides MirrorYARPCServer procedures to an Fx application. // It expects a MirrorYARPCServer to be present in the container. // -// fx.Provide( -// mirror.NewFxMirrorYARPCProcedures(), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorYARPCProcedures(), +// ... +// ) func NewFxMirrorYARPCProcedures() interface{} { return func(params FxMirrorYARPCProceduresParams) FxMirrorYARPCProceduresResult { return FxMirrorYARPCProceduresResult{ @@ -311,10 +311,10 @@ type FxMirrorInternalYARPCClientResult struct { // NewFxMirrorInternalYARPCClient provides a MirrorInternalYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// mirror.NewFxMirrorInternalYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorInternalYARPCClient("service-name"), +// ... +// ) func NewFxMirrorInternalYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxMirrorInternalYARPCClientParams) FxMirrorInternalYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -360,10 +360,10 @@ type FxMirrorInternalYARPCProceduresResult struct { // NewFxMirrorInternalYARPCProcedures provides MirrorInternalYARPCServer procedures to an Fx application. // It expects a MirrorInternalYARPCServer to be present in the container. // -// fx.Provide( -// mirror.NewFxMirrorInternalYARPCProcedures(), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorInternalYARPCProcedures(), +// ... +// ) func NewFxMirrorInternalYARPCProcedures() interface{} { return func(params FxMirrorInternalYARPCProceduresParams) FxMirrorInternalYARPCProceduresResult { return FxMirrorInternalYARPCProceduresResult{ From 1847d96edae354389fe61a66300e2e9730dc8040 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Wed, 28 Jun 2023 10:27:00 +0000 Subject: [PATCH 06/86] remove trailing whitespaces --- codegen/template_bundle/template_files.go | 14 +++++++------- codegen/templates/endpoint.tmpl | 2 +- codegen/templates/workflow.tmpl | 8 ++++---- .../endpoints/bar/bar_bar_method_argwithheaders.go | 1 - .../bar/bar_bar_method_argwithmanyqueryparams.go | 1 - .../bar_bar_method_argwithneardupqueryparams.go | 1 - .../bar/bar_bar_method_argwithnestedqueryparams.go | 1 - .../endpoints/bar/bar_bar_method_argwithparams.go | 1 - ...r_bar_method_argwithparamsandduplicatefields.go | 1 - .../bar/bar_bar_method_argwithqueryheader.go | 1 - .../bar/bar_bar_method_argwithqueryparams.go | 1 - .../endpoints/bar/bar_bar_method_deletewithbody.go | 1 - .../bar/workflow/bar_bar_method_argnotstruct.go | 2 -- .../bar/workflow/bar_bar_method_argwithheaders.go | 2 -- .../bar_bar_method_argwithmanyqueryparams.go | 2 -- .../bar_bar_method_argwithneardupqueryparams.go | 2 -- .../bar_bar_method_argwithnestedqueryparams.go | 2 -- .../bar/workflow/bar_bar_method_argwithparams.go | 2 -- ...r_bar_method_argwithparamsandduplicatefields.go | 2 -- .../workflow/bar_bar_method_argwithqueryheader.go | 2 -- .../workflow/bar_bar_method_argwithqueryparams.go | 2 -- .../bar/workflow/bar_bar_method_deletewithbody.go | 2 -- .../bar/workflow/bar_bar_method_helloworld.go | 2 -- .../bar/workflow/bar_bar_method_listandenum.go | 2 -- .../bar/workflow/bar_bar_method_missingarg.go | 2 -- .../bar/workflow/bar_bar_method_norequest.go | 2 -- .../bar/workflow/bar_bar_method_normal.go | 2 -- .../bar/workflow/bar_bar_method_toomanyargs.go | 2 -- .../endpoints/baz/baz_simpleservice_method_ping.go | 1 - .../baz/workflow/baz_simpleservice_method_call.go | 2 -- .../workflow/baz_simpleservice_method_compare.go | 2 -- .../baz_simpleservice_method_getprofile.go | 2 -- .../baz_simpleservice_method_headerschema.go | 2 -- .../baz/workflow/baz_simpleservice_method_ping.go | 2 -- .../workflow/baz_simpleservice_method_sillynoop.go | 2 -- .../baz/workflow/baz_simpleservice_method_trans.go | 2 -- .../baz_simpleservice_method_transheaders.go | 2 -- .../baz_simpleservice_method_transheadersnoreq.go | 2 -- .../baz_simpleservice_method_transheaderstype.go | 2 -- .../clientless_clientless_method_beta.go | 1 - ...s_clientless_method_clientlessargwithheaders.go | 1 - ...ess_clientless_method_emptyclientlessrequest.go | 1 - .../googlenow_googlenow_method_addcredentials.go | 1 - .../googlenow_googlenow_method_checkcredentials.go | 1 - .../googlenow_googlenow_method_addcredentials.go | 2 -- .../googlenow_googlenow_method_checkcredentials.go | 2 -- .../multi/multi_serviceafront_method_hello.go | 1 - .../multi/multi_servicebfront_method_hello.go | 1 - .../workflow/multi_serviceafront_method_hello.go | 2 -- .../workflow/multi_servicebfront_method_hello.go | 2 -- .../panic/panic_servicecfront_method_hello.go | 1 - .../withexceptions_withexceptions_method_func1.go | 2 -- 52 files changed, 12 insertions(+), 92 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 09b111c0c..3ae5177ef 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -644,7 +644,7 @@ func (h *{{$handlerName}}) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - {{if eq (len .Exceptions) 0}} + {{if eq (len .Exceptions) 0 -}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} @@ -705,7 +705,7 @@ func endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "endpoint.tmpl", size: 8030, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "endpoint.tmpl", size: 8032, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4673,13 +4673,13 @@ func (w {{$workflowStruct}}) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - {{if eq $responseType ""}} + {{if eq $responseType "" -}} return ctx, nil, err - {{else if eq $responseType "string" }} + {{else if eq $responseType "string" -}} return ctx, "", nil, err - {{else}} + {{else -}} return ctx, nil, nil, err - {{end}} + {{- end -}} } // Filter and map response headers from client to server response. @@ -4754,7 +4754,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10619, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10628, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/codegen/templates/endpoint.tmpl b/codegen/templates/endpoint.tmpl index aaa7f97fa..e5bd1a20b 100644 --- a/codegen/templates/endpoint.tmpl +++ b/codegen/templates/endpoint.tmpl @@ -220,7 +220,7 @@ func (h *{{$handlerName}}) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - {{if eq (len .Exceptions) 0}} + {{if eq (len .Exceptions) 0 -}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} diff --git a/codegen/templates/workflow.tmpl b/codegen/templates/workflow.tmpl index 8f31babbc..98c24fb4c 100644 --- a/codegen/templates/workflow.tmpl +++ b/codegen/templates/workflow.tmpl @@ -247,13 +247,13 @@ func (w {{$workflowStruct}}) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - {{if eq $responseType ""}} + {{if eq $responseType "" -}} return ctx, nil, err - {{else if eq $responseType "string" }} + {{else if eq $responseType "string" -}} return ctx, "", nil, err - {{else}} + {{else -}} return ctx, nil, nil, err - {{end}} + {{- end -}} } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go index dd1cc0868..be53604e8 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go @@ -176,7 +176,6 @@ func (h *BarArgWithHeadersHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go index eb98461a2..bd7010235 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go @@ -479,7 +479,6 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go index e0d99324d..659197ee7 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go @@ -202,7 +202,6 @@ func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go index fac805b6d..afd35f2c2 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go @@ -258,7 +258,6 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go index bba729ca8..be5d09bb9 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go @@ -173,7 +173,6 @@ func (h *BarArgWithParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go index c0aacea40..9b59292f6 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go @@ -169,7 +169,6 @@ func (h *BarArgWithParamsAndDuplicateFieldsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go index cc14126f1..8bdb04f8f 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go @@ -170,7 +170,6 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go index 7508f0b51..631aa1217 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go @@ -203,7 +203,6 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go index 8e4daed0d..bd2c46e31 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go @@ -145,7 +145,6 @@ func (h *BarDeleteWithBodyHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go index a8e4d5752..0777d3390 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go @@ -149,9 +149,7 @@ func (w barArgNotStructWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go index ece5587aa..f31170900 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go @@ -148,9 +148,7 @@ func (w barArgWithHeadersWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go index 12b9ea68b..15f7e882f 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go @@ -144,9 +144,7 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go index ff965fd97..e841f1ffb 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go @@ -144,9 +144,7 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go index a1c68a6df..09d7b017a 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go @@ -144,9 +144,7 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go index c2831d4b1..79b2fa2dc 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go @@ -144,9 +144,7 @@ func (w barArgWithParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go index ae79c955b..d2eac8c8a 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go @@ -144,9 +144,7 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go index 41e9fe4c4..085371fcf 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go @@ -144,9 +144,7 @@ func (w barArgWithQueryHeaderWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go index 07472c5d4..f7dd31cd4 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go @@ -152,9 +152,7 @@ func (w barArgWithQueryParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go index 07bac7604..fe1f0c8d2 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go @@ -144,9 +144,7 @@ func (w barDeleteWithBodyWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go index 922e12225..dbad9e7bd 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go @@ -151,9 +151,7 @@ func (w barHelloWorldWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go index d89ef3445..738972bf6 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go @@ -149,9 +149,7 @@ func (w barListAndEnumWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go index c37017c24..b648dcf6c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go @@ -146,9 +146,7 @@ func (w barMissingArgWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go index ff18943dc..04cc0733a 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go @@ -146,9 +146,7 @@ func (w barNoRequestWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go index 6555ed961..c7c9e0072 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go @@ -149,9 +149,7 @@ func (w barNormalWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go index 85228236f..c803b65eb 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go @@ -165,9 +165,7 @@ func (w barTooManyArgsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go index 410cf0d7d..455f961eb 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go @@ -137,7 +137,6 @@ func (h *SimpleServicePingHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go index eb400aaef..cf0877ae6 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go @@ -157,9 +157,7 @@ func (w simpleServiceCallWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go index 6af1e8ee6..c221f5ace 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go @@ -155,9 +155,7 @@ func (w simpleServiceCompareWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go index 6abb63f57..42c195148 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go @@ -149,9 +149,7 @@ func (w simpleServiceGetProfileWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go index 3c952fb66..ae3c9aa59 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go @@ -170,9 +170,7 @@ func (w simpleServiceHeaderSchemaWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go index 96d243da0..74623f648 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go @@ -141,9 +141,7 @@ func (w simpleServicePingWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go index 196b13436..edc99b6e5 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go @@ -150,9 +150,7 @@ func (w simpleServiceSillyNoopWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go index d4dad45d0..843637eeb 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go @@ -155,9 +155,7 @@ func (w simpleServiceTransWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go index 3b8b1684a..00b177fd2 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go @@ -164,9 +164,7 @@ func (w simpleServiceTransHeadersWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go index b6de8b6fa..f441b0d33 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go @@ -161,9 +161,7 @@ func (w simpleServiceTransHeadersNoReqWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go index ab10652cf..474c9dc87 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go @@ -156,9 +156,7 @@ func (w simpleServiceTransHeadersTypeWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go index 728cb69b5..8ee668432 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go @@ -167,7 +167,6 @@ func (h *ClientlessBetaHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go index b832d5e80..10dd28de5 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go @@ -178,7 +178,6 @@ func (h *ClientlessClientlessArgWithHeadersHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go index fe8c447a9..f83e3d51e 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go @@ -152,7 +152,6 @@ func (h *ClientlessEmptyclientlessRequestHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go index 64c8d4e29..969ccc526 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go @@ -148,7 +148,6 @@ func (h *GoogleNowAddCredentialsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go index 08022c5e9..55efad4d1 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go @@ -141,7 +141,6 @@ func (h *GoogleNowCheckCredentialsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go index aa4b0377b..830adbc5b 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go @@ -152,9 +152,7 @@ func (w googleNowAddCredentialsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go index ddd2c4c68..da775b4d5 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go @@ -144,9 +144,7 @@ func (w googleNowCheckCredentialsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go index 8aa679135..9d632d4d3 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go @@ -138,7 +138,6 @@ func (h *ServiceAFrontHelloHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go index b54960d0c..c0e541e91 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go @@ -138,7 +138,6 @@ func (h *ServiceBFrontHelloHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go index 3c25084b8..cefa360dc 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go @@ -138,9 +138,7 @@ func (w serviceAFrontHelloWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go index d5b257147..850f9264e 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go @@ -138,9 +138,7 @@ func (w serviceBFrontHelloWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go index c0f36197f..4cd7be1e3 100644 --- a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go @@ -138,7 +138,6 @@ func (h *ServiceCFrontHelloHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go index f87688d4c..727486489 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go @@ -151,9 +151,7 @@ func (w withExceptionsFunc1Workflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. From 51db40c7ab6bccbbd114ab9f0439e2353db04cf4 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Thu, 29 Jun 2023 06:37:49 +0000 Subject: [PATCH 07/86] fix error building --- codegen/templates/workflow.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codegen/templates/workflow.tmpl b/codegen/templates/workflow.tmpl index 98c24fb4c..b8eb81278 100644 --- a/codegen/templates/workflow.tmpl +++ b/codegen/templates/workflow.tmpl @@ -246,7 +246,9 @@ func (w {{$workflowStruct}}) Handle( zap.String("client", "{{$clientName}}"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } {{if eq $responseType "" -}} return ctx, nil, err {{else if eq $responseType "string" -}} From 4f374b1cdc93e634ded38e5d4ee6f98dcd613a3b Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Thu, 29 Jun 2023 06:39:15 +0000 Subject: [PATCH 08/86] gen code --- codegen/template_bundle/template_files.go | 6 ++++-- .../endpoints/bar/workflow/bar_bar_method_argnotstruct.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_argwithheaders.go | 4 +++- .../bar/workflow/bar_bar_method_argwithmanyqueryparams.go | 4 +++- .../workflow/bar_bar_method_argwithneardupqueryparams.go | 4 +++- .../bar/workflow/bar_bar_method_argwithnestedqueryparams.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_argwithparams.go | 4 +++- .../bar_bar_method_argwithparamsandduplicatefields.go | 4 +++- .../bar/workflow/bar_bar_method_argwithqueryheader.go | 4 +++- .../bar/workflow/bar_bar_method_argwithqueryparams.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_deletewithbody.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_helloworld.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_listandenum.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_missingarg.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_norequest.go | 4 +++- .../build/endpoints/bar/workflow/bar_bar_method_normal.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_toomanyargs.go | 4 +++- .../endpoints/baz/workflow/baz_simpleservice_method_call.go | 4 +++- .../baz/workflow/baz_simpleservice_method_compare.go | 4 +++- .../baz/workflow/baz_simpleservice_method_getprofile.go | 4 +++- .../baz/workflow/baz_simpleservice_method_headerschema.go | 4 +++- .../endpoints/baz/workflow/baz_simpleservice_method_ping.go | 4 +++- .../baz/workflow/baz_simpleservice_method_sillynoop.go | 4 +++- .../baz/workflow/baz_simpleservice_method_trans.go | 4 +++- .../baz/workflow/baz_simpleservice_method_transheaders.go | 4 +++- .../workflow/baz_simpleservice_method_transheadersnoreq.go | 4 +++- .../workflow/baz_simpleservice_method_transheaderstype.go | 4 +++- .../workflow/googlenow_googlenow_method_addcredentials.go | 4 +++- .../workflow/googlenow_googlenow_method_checkcredentials.go | 4 +++- .../multi/workflow/multi_serviceafront_method_hello.go | 4 +++- .../multi/workflow/multi_servicebfront_method_hello.go | 4 +++- .../workflow/withexceptions_withexceptions_method_func1.go | 4 +++- 32 files changed, 97 insertions(+), 33 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 3ae5177ef..4a2f30c71 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -4672,7 +4672,9 @@ func (w {{$workflowStruct}}) Handle( zap.String("client", "{{$clientName}}"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } {{if eq $responseType "" -}} return ctx, nil, err {{else if eq $responseType "string" -}} @@ -4754,7 +4756,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10628, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10652, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go index 0777d3390..2f10f0bb4 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go @@ -148,7 +148,9 @@ func (w barArgNotStructWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go index f31170900..4c0b02965 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go @@ -147,7 +147,9 @@ func (w barArgWithHeadersWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go index 15f7e882f..d04f2df1c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go @@ -143,7 +143,9 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go index e841f1ffb..6bf7da6ab 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go @@ -143,7 +143,9 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go index 09d7b017a..391bf4721 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go @@ -143,7 +143,9 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go index 79b2fa2dc..1a16d6053 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go @@ -143,7 +143,9 @@ func (w barArgWithParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go index d2eac8c8a..2cc796333 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go @@ -143,7 +143,9 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go index 085371fcf..896997801 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go @@ -143,7 +143,9 @@ func (w barArgWithQueryHeaderWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go index f7dd31cd4..3f8776622 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go @@ -151,7 +151,9 @@ func (w barArgWithQueryParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go index fe1f0c8d2..ec7e0579c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go @@ -143,7 +143,9 @@ func (w barDeleteWithBodyWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go index dbad9e7bd..d8643ce06 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go @@ -150,7 +150,9 @@ func (w barHelloWorldWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, "", nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go index 738972bf6..f0dde908c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go @@ -148,7 +148,9 @@ func (w barListAndEnumWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, "", nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go index b648dcf6c..4dee33a6a 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go @@ -145,7 +145,9 @@ func (w barMissingArgWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go index 04cc0733a..68fd2aa9b 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go @@ -145,7 +145,9 @@ func (w barNoRequestWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go index c7c9e0072..1ba7ebbaa 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go @@ -148,7 +148,9 @@ func (w barNormalWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go index c803b65eb..22ae30646 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go @@ -164,7 +164,9 @@ func (w barTooManyArgsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go index cf0877ae6..998835faf 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go @@ -156,7 +156,9 @@ func (w simpleServiceCallWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go index c221f5ace..0a3513fb2 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go @@ -154,7 +154,9 @@ func (w simpleServiceCompareWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go index 42c195148..47493c6ea 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go @@ -148,7 +148,9 @@ func (w simpleServiceGetProfileWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go index ae3c9aa59..bbed04559 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go @@ -169,7 +169,9 @@ func (w simpleServiceHeaderSchemaWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go index 74623f648..b96609e92 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go @@ -140,7 +140,9 @@ func (w simpleServicePingWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go index edc99b6e5..33d2b7680 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go @@ -149,7 +149,9 @@ func (w simpleServiceSillyNoopWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go index 843637eeb..a89b11528 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go @@ -154,7 +154,9 @@ func (w simpleServiceTransWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go index 00b177fd2..ed0f8fb70 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go @@ -163,7 +163,9 @@ func (w simpleServiceTransHeadersWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go index f441b0d33..ca5f5ba5d 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go @@ -160,7 +160,9 @@ func (w simpleServiceTransHeadersNoReqWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go index 474c9dc87..a96f34b5e 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go @@ -155,7 +155,9 @@ func (w simpleServiceTransHeadersTypeWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go index 830adbc5b..c345f0be0 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go @@ -151,7 +151,9 @@ func (w googleNowAddCredentialsWorkflow) Handle( zap.String("client", "GoogleNow"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go index da775b4d5..5b4e63def 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go @@ -143,7 +143,9 @@ func (w googleNowCheckCredentialsWorkflow) Handle( zap.String("client", "GoogleNow"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go index cefa360dc..39db04a86 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go @@ -137,7 +137,9 @@ func (w serviceAFrontHelloWorkflow) Handle( zap.String("client", "Multi"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, "", nil, err } diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go index 850f9264e..e41763405 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go @@ -137,7 +137,9 @@ func (w serviceBFrontHelloWorkflow) Handle( zap.String("client", "Multi"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, "", nil, err } diff --git a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go index 727486489..d25272f36 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go @@ -150,7 +150,9 @@ func (w withExceptionsFunc1Workflow) Handle( zap.String("client", "Withexceptions"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } From e90bd98b767e2c10010b2125f3b5a8eef8ad7cc0 Mon Sep 17 00:00:00 2001 From: groshu <90900462+groshu@users.noreply.github.com> Date: Thu, 22 Jun 2023 14:44:33 +0530 Subject: [PATCH 09/86] Fix spacing bug in tag (#878) --- codegen/gateway.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/gateway.go b/codegen/gateway.go index db73fb2ac..0353530da 100644 --- a/codegen/gateway.go +++ b/codegen/gateway.go @@ -260,7 +260,7 @@ type EndpointSpec struct { // If "custom" then where to import custom code from WorkflowImportPath string `yaml:"workflowImportPath"` // Config additional configs for the endpoint - Config map[string]interface{} `yaml:"config, omitempty"` + Config map[string]interface{} `yaml:"config,omitempty"` // if "httpClient", which client to call. ClientID string `yaml:"clientId,omitempty"` // if "httpClient", which client method to call. From 7f915a2fdc2e97fe14cff384a1de6cfe66cb3a7b Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Thu, 29 Jun 2023 00:35:32 +0530 Subject: [PATCH 10/86] fix inconsistent log fields --- runtime/client_http_request.go | 6 ----- runtime/client_http_response.go | 3 +-- runtime/context.go | 24 +++++++++---------- runtime/grpc_client.go | 5 +--- runtime/server_http_request.go | 2 -- runtime/server_http_request_test.go | 3 --- runtime/server_http_response.go | 1 - runtime/tchannel_client_test.go | 6 ++--- runtime/tchannel_inbound_call.go | 4 +--- runtime/tchannel_outbound_call.go | 4 +--- test/endpoints/bar/bar_metrics_test.go | 16 +++++-------- .../baz/baz_simpleservice_method_call_test.go | 10 ++------ 12 files changed, 26 insertions(+), 58 deletions(-) diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index f31960e29..05fd62e58 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -190,12 +190,6 @@ func (req *ClientHTTPRequest) WriteBytes( } req.httpReq = httpReq - req.ctx = WithLogFields(req.ctx, - zap.String(logFieldClientHTTPMethod, method), - zap.String(logFieldRequestURL, url), - zap.Time(logFieldRequestStartTime, req.startTime), - ) - return nil } diff --git a/runtime/client_http_response.go b/runtime/client_http_response.go index e8d41c75f..8b85cb9d1 100644 --- a/runtime/client_http_response.go +++ b/runtime/client_http_response.go @@ -222,8 +222,7 @@ func (res *ClientHTTPResponse) finish() { func clientHTTPLogFields(req *ClientHTTPRequest, res *ClientHTTPResponse) []zapcore.Field { fields := []zapcore.Field{ - zap.Time(logFieldRequestFinishedTime, res.finishTime), - zap.Int(logFieldResponseStatusCode, res.StatusCode), + zap.Int(logFieldClientStatusCode, res.StatusCode), } for k, v := range req.httpReq.Header { if len(v) > 0 { diff --git a/runtime/context.go b/runtime/context.go index 90d8a3e5c..5cdc6abd3 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -52,19 +52,17 @@ const ( const ( // thrift service::method of endpoint thrift spec - logFieldRequestMethod = "endpointThriftMethod" - logFieldRequestHTTPMethod = "method" - logFieldRequestURL = "url" - logFieldRequestPathname = "pathname" - logFieldRequestRemoteAddr = "remoteAddr" - logFieldRequestHost = "host" - logFieldRequestStartTime = "timestamp-started" - logFieldRequestFinishedTime = "timestamp-finished" - logFieldResponseStatusCode = "statusCode" - logFieldRequestUUID = "requestUUID" - logFieldEndpointID = "endpointID" - logFieldEndpointHandler = "endpointHandler" - logFieldClientHTTPMethod = "clientHTTPMethod" + logFieldRequestMethod = "endpointThriftMethod" + logFieldRequestHTTPMethod = "method" + logFieldRequestPathname = "pathname" + logFieldRequestRemoteAddr = "remoteAddr" + logFieldRequestHost = "host" + logFieldResponseStatusCode = "statusCode" + logFieldRequestUUID = "requestUUID" + logFieldEndpointID = "endpointID" + logFieldEndpointHandler = "endpointHandler" + logFieldClientStatusCode = "client_status_code" + logFieldClientRemoteAddr = "client_remote_addr" logFieldClientRequestHeaderPrefix = "Client-Req-Header" logFieldClientResponseHeaderPrefix = "Client-Res-Header" diff --git a/runtime/grpc_client.go b/runtime/grpc_client.go index 27e2d3be4..57f9244bb 100644 --- a/runtime/grpc_client.go +++ b/runtime/grpc_client.go @@ -112,10 +112,7 @@ func (c *callHelper) Finish(ctx context.Context, err error) context.Context { delta := c.finishTime.Sub(c.startTime) c.metrics.RecordTimer(ctx, clientLatency, delta) c.metrics.RecordHistogramDuration(ctx, clientLatency, delta) - fields := []zapcore.Field{ - zap.Time(logFieldRequestStartTime, c.startTime), - zap.Time(logFieldRequestFinishedTime, c.finishTime), - } + var fields []zapcore.Field ctx = WithEndpointRequestHeadersField(ctx, map[string]string{}) if c.extractor != nil { fields = append(fields, c.extractor.ExtractLogFields(ctx)...) diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index b30284dcb..53fca540e 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -78,7 +78,6 @@ func NewServerHTTPRequest( logFields := []zap.Field{ zap.String(logFieldEndpointID, endpoint.EndpointName), zap.String(logFieldEndpointHandler, endpoint.HandlerName), - zap.String(logFieldRequestURL, r.URL.Path), zap.String(logFieldRequestHTTPMethod, r.Method), zap.String(logFieldRequestRemoteAddr, r.RemoteAddr), zap.String(logFieldRequestPathname, r.URL.RequestURI()), @@ -214,7 +213,6 @@ func (req *ServerHTTPRequest) start() { func (req *ServerHTTPRequest) setupLogFields() { fields := GetLogFieldsFromCtx(req.Context()) - fields = append(fields, zap.Time(logFieldRequestStartTime, req.startTime)) if span := req.GetSpan(); span != nil { jc, ok := span.Context().(jaeger.SpanContext) if ok { diff --git a/runtime/server_http_request_test.go b/runtime/server_http_request_test.go index 0f88f2a9f..cb5446010 100644 --- a/runtime/server_http_request_test.go +++ b/runtime/server_http_request_test.go @@ -2369,12 +2369,10 @@ func testIncomingHTTPRequestServerLog(t *testing.T, isShadowRequest bool, enviro dynamicHeaders := []string{ "requestUUID", "remoteAddr", - "timestamp-started", "ts", "hostname", "host", "pid", - "timestamp-finished", zanzibar.TraceIDKey, zanzibar.TraceSpanKey, zanzibar.TraceSampledKey, @@ -2400,7 +2398,6 @@ func testIncomingHTTPRequestServerLog(t *testing.T, isShadowRequest bool, enviro "statusCode": float64(200), "endpointHandler": "foo", "endpointID": "foo", - "url": "/foo", "Accept-Encoding": "gzip", "User-Agent": "Go-http-client/1.1", diff --git a/runtime/server_http_response.go b/runtime/server_http_response.go index 4ca72c087..3a52ce0de 100644 --- a/runtime/server_http_response.go +++ b/runtime/server_http_response.go @@ -140,7 +140,6 @@ func (res *ServerHTTPResponse) finish(ctx context.Context) { func serverHTTPLogFields(req *ServerHTTPRequest, res *ServerHTTPResponse) []zapcore.Field { fields := []zapcore.Field{ - zap.Time(logFieldRequestFinishedTime, res.finishTime), zap.Int(logFieldResponseStatusCode, res.StatusCode), } diff --git a/runtime/tchannel_client_test.go b/runtime/tchannel_client_test.go index 4ab03a905..f643c841d 100644 --- a/runtime/tchannel_client_test.go +++ b/runtime/tchannel_client_test.go @@ -49,13 +49,13 @@ func TestNilCallReferenceForLogger(t *testing.T) { fields := outboundCall.logFields(ctx) // one field for each of the: - // timestamp-started, timestamp-finished, remoteAddr, requestHeader, responseHeader + // timestamp-started, timestamp-finished, clientRemoteAddr, requestHeader, responseHeader assert.Len(t, fields, 6) var addr, reqKey, resKey, foo bool for _, f := range fields { switch f.Key { - case "remoteAddr": + case "clientRemoteAddr": assert.Equal(t, f.String, "unknown") addr = true case "Client-Req-Header-header-key": @@ -69,7 +69,7 @@ func TestNilCallReferenceForLogger(t *testing.T) { foo = true } } - assert.True(t, addr, "remoteAddr key not present") + assert.True(t, addr, "clientRemoteAddr key not present") assert.True(t, reqKey, "Client-Req-Header-header-key key not present") assert.True(t, resKey, "Client-Res-Header-header-key key not present") assert.True(t, foo, "foo key not present") diff --git a/runtime/tchannel_inbound_call.go b/runtime/tchannel_inbound_call.go index 9193ea4b4..26e7334ec 100644 --- a/runtime/tchannel_inbound_call.go +++ b/runtime/tchannel_inbound_call.go @@ -82,10 +82,8 @@ func (c *tchannelInboundCall) finish(ctx context.Context, err error) { func (c *tchannelInboundCall) logFields(ctx context.Context) []zap.Field { fields := []zap.Field{ - zap.String("remoteAddr", c.call.RemotePeer().HostPort), + zap.String(logFieldRequestRemoteAddr, c.call.RemotePeer().HostPort), zap.String("calling-service", c.call.CallerName()), - zap.Time("timestamp-started", c.startTime), - zap.Time("timestamp-finished", c.finishTime), } for k, v := range c.resHeaders { diff --git a/runtime/tchannel_outbound_call.go b/runtime/tchannel_outbound_call.go index 7bf79a64e..d799751e3 100644 --- a/runtime/tchannel_outbound_call.go +++ b/runtime/tchannel_outbound_call.go @@ -91,9 +91,7 @@ func (c *tchannelOutboundCall) logFields(ctx context.Context) []zapcore.Field { hostPort = "unknown" } fields := []zapcore.Field{ - zap.String("remoteAddr", hostPort), - zap.Time("timestamp-started", c.startTime), - zap.Time("timestamp-finished", c.finishTime), + zap.String(logFieldClientRemoteAddr, hostPort), } headers := map[string]string{} diff --git a/test/endpoints/bar/bar_metrics_test.go b/test/endpoints/bar/bar_metrics_test.go index 4b4c7764d..9325b324a 100644 --- a/test/endpoints/bar/bar_metrics_test.go +++ b/test/endpoints/bar/bar_metrics_test.go @@ -200,13 +200,10 @@ func TestCallMetrics(t *testing.T) { assert.Len(t, logMsgs, 1) logMsg := logMsgs[0] dynamicHeaders := []string{ - "url", - "timestamp-finished", "Client-Req-Header-Uber-Trace-Id", "Client-Req-Header-X-Request-Uuid", "Client-Res-Header-Content-Length", "Client-Res-Header-Date", - "timestamp-started", "ts", "hostname", "pid", @@ -222,20 +219,19 @@ func TestCallMetrics(t *testing.T) { delete(logMsg, dynamicValue) } expectedValues := map[string]interface{}{ - "env": "test", - "level": "debug", - "msg": "Finished an outgoing client HTTP request", - "statusCode": float64(200), - "method": "POST", - "pathname": "/bar/bar-path", + "env": "test", + "level": "debug", + "msg": "Finished an outgoing client HTTP request", + "method": "POST", + "pathname": "/bar/bar-path", //"clientID": "bar", //"clientMethod": "Normal", //"clientThriftMethod": "Bar::normal", - "clientHTTPMethod": "POST", "Client-Req-Header-X-Client-Id": "bar", "Client-Req-Header-Content-Type": "application/json", "Client-Req-Header-Accept": "application/json", "Client-Res-Header-Content-Type": "text/plain; charset=utf-8", + "client_status_code": float64(200), "zone": "unknown", "service": "example-gateway", diff --git a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go index d05e2889b..075ec30c0 100644 --- a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go +++ b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go @@ -125,13 +125,12 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { logs := allLogs["Finished an incoming server TChannel request"][0] dynamicHeaders := []string{ "requestUUID", - "timestamp-started", - "timestamp-finished", "remoteAddr", "ts", "hostname", "pid", "Res-Header-client.response.duration", + "client_remote_addr", } for _, dynamicValue := range dynamicHeaders { assert.Contains(t, logs, dynamicValue) @@ -165,13 +164,12 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { dynamicHeaders = []string{ "requestUUID", "remoteAddr", - "timestamp-started", "ts", "hostname", "pid", - "timestamp-finished", "Client-Req-Header-x-request-uuid", "Client-Req-Header-$tracing$uber-trace-id", + "client_remote_addr", zanzibar.TraceIDKey, zanzibar.TraceSpanKey, zanzibar.TraceSampledKey, @@ -198,10 +196,6 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { "Regionname": "sf", // client specific logs - //"clientID": "baz", - //"clientService": "bazService", - //"clientThriftMethod": "SimpleService::call", - //"clientMethod": "Call", "Client-Req-Header-Device": "ios", "Client-Req-Header-x-uuid": "uuid", "Client-Req-Header-Regionname": "sf", From f24755c74f660358ac7016a20e8cb8f809622a67 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Thu, 29 Jun 2023 10:27:47 +0530 Subject: [PATCH 11/86] fix test --- runtime/client_http_request_test.go | 6 +----- runtime/tchannel_client_test.go | 8 ++++---- .../tchannel/baz/baz_simpleservice_method_call_test.go | 4 +--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/runtime/client_http_request_test.go b/runtime/client_http_request_test.go index c77eb9d5f..2557f63c3 100644 --- a/runtime/client_http_request_test.go +++ b/runtime/client_http_request_test.go @@ -411,11 +411,8 @@ func TestMakingClientCallWithRespHeaders(t *testing.T) { logMsg := logMsgs[0] dynamicHeaders := []string{ - "url", - "timestamp-finished", "Client-Req-Header-Uber-Trace-Id", "Client-Res-Header-Content-Length", - "timestamp-started", "Client-Res-Header-Date", "ts", "hostname", @@ -432,13 +429,12 @@ func TestMakingClientCallWithRespHeaders(t *testing.T) { "env": "test", "zone": "unknown", "service": "example-gateway", - "statusCode": float64(200), - "clientHTTPMethod": "POST", "Client-Req-Header-X-Client-Id": "bar", "Client-Req-Header-Content-Type": "application/json", "Client-Req-Header-Accept": "application/json", "Client-Res-Header-Example-Header": "Example-Value", "Client-Res-Header-Content-Type": "text/plain; charset=utf-8", + "client_status_code": float64(200), } for actualKey, actualValue := range logMsg { assert.Equal(t, expectedValues[actualKey], actualValue, "unexpected field %q", actualKey) diff --git a/runtime/tchannel_client_test.go b/runtime/tchannel_client_test.go index f643c841d..d0d03fe51 100644 --- a/runtime/tchannel_client_test.go +++ b/runtime/tchannel_client_test.go @@ -49,13 +49,13 @@ func TestNilCallReferenceForLogger(t *testing.T) { fields := outboundCall.logFields(ctx) // one field for each of the: - // timestamp-started, timestamp-finished, clientRemoteAddr, requestHeader, responseHeader - assert.Len(t, fields, 6) + // client_remote_addr, requestHeader, responseHeader + assert.Len(t, fields, 4) var addr, reqKey, resKey, foo bool for _, f := range fields { switch f.Key { - case "clientRemoteAddr": + case "client_remote_addr": assert.Equal(t, f.String, "unknown") addr = true case "Client-Req-Header-header-key": @@ -69,7 +69,7 @@ func TestNilCallReferenceForLogger(t *testing.T) { foo = true } } - assert.True(t, addr, "clientRemoteAddr key not present") + assert.True(t, addr, "client_remote_addr key not present") assert.True(t, reqKey, "Client-Req-Header-header-key key not present") assert.True(t, resKey, "Client-Res-Header-header-key key not present") assert.True(t, foo, "foo key not present") diff --git a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go index 075ec30c0..026edaeb0 100644 --- a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go +++ b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go @@ -130,7 +130,6 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { "hostname", "pid", "Res-Header-client.response.duration", - "client_remote_addr", } for _, dynamicValue := range dynamicHeaders { assert.Contains(t, logs, dynamicValue) @@ -163,13 +162,12 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { logs = allLogs["Finished an outgoing client TChannel request"][0] dynamicHeaders = []string{ "requestUUID", - "remoteAddr", + "client_remote_addr", "ts", "hostname", "pid", "Client-Req-Header-x-request-uuid", "Client-Req-Header-$tracing$uber-trace-id", - "client_remote_addr", zanzibar.TraceIDKey, zanzibar.TraceSpanKey, zanzibar.TraceSampledKey, From 906ed9fc6565a95a4f9d8b9c4281b30b483d0313 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 30 Jun 2023 12:31:11 +0530 Subject: [PATCH 12/86] log error_type, error_location --- codegen/templates/tchannel_client.tmpl | 17 ++++++++++++++--- runtime/context.go | 13 +++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index 7b2bc086f..dfbc88aaf 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -356,6 +356,17 @@ type {{$clientName}} struct { var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if (c.circuitBreakerDisabled) { success, respHeaders, err = c.client.Call( ctx, "{{$svc.Name}}", "{{.Name}}", reqHeaders, args, &result, timeoutAndRetryCfg, @@ -397,7 +408,7 @@ type {{$clientName}} struct { {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding") success = true {{end -}} default: @@ -406,7 +417,7 @@ type {{$clientName}} struct { } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") {{if eq .ResponseType "" -}} return ctx, respHeaders, err {{else -}} @@ -420,7 +431,7 @@ type {{$clientName}} struct { resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err {{end -}} diff --git a/runtime/context.go b/runtime/context.go index 5cdc6abd3..a173a9b76 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -67,6 +67,12 @@ const ( logFieldClientRequestHeaderPrefix = "Client-Req-Header" logFieldClientResponseHeaderPrefix = "Client-Res-Header" logFieldEndpointResponseHeaderPrefix = "Res-Header" + + // LogFieldErrorLocation is field name to log error location. + LogFieldErrorLocation = "error_location" + + // LogFieldErrorType is field name to log error type. + LogFieldErrorType = "error_type" ) const ( @@ -373,6 +379,9 @@ type ContextLogger interface { Check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry SetSkipZanzibarLogs(bool) + + // Append appends the fields to the context. + Append(ctx context.Context, fields ...zap.Field) context.Context } // NewContextLogger returns a logger that extracts log fields a context before passing through to underlying zap logger. @@ -397,6 +406,10 @@ type contextLogger struct { skipZanzibarLogs bool } +func (c *contextLogger) Append(ctx context.Context, fields ...zap.Field) context.Context { + return WithLogFields(ctx, fields...) +} + func (c *contextLogger) Debug(ctx context.Context, msg string, userFields ...zap.Field) context.Context { c.log.Debug(msg, accumulateLogFields(ctx, userFields)...) return ctx From d95a6eb3c3c77a8d02039c30acb0bad75d45a5a4 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 26 Jun 2023 17:33:43 +0530 Subject: [PATCH 13/86] add Error interface and implementation --- runtime/error.go | 32 +++++++++++++++ runtime/error_builder.go | 81 +++++++++++++++++++++++++++++++++++++ runtime/errortype_string.go | 26 ++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 runtime/error.go create mode 100644 runtime/error_builder.go create mode 100644 runtime/errortype_string.go diff --git a/runtime/error.go b/runtime/error.go new file mode 100644 index 000000000..3b7e06493 --- /dev/null +++ b/runtime/error.go @@ -0,0 +1,32 @@ +package zanzibar + +// ErrorType is used for error grouping. +type ErrorType int + +const ( + // TChannelError are errors of type tchannel.SystemError + TChannelError ErrorType = iota + 1 + // ClientException are client exceptions defined in the + // client IDL. + ClientException + // BadResponse are errors reading client response such + // as undefined exceptions, empty response. + BadResponse +) + +//go:generate stringer -type=ErrorType + +// Error extends error interface to set meta fields about +// error that are logged to improve error debugging, as well +// as to facilitate error grouping and filtering in logs. +type Error interface { + error + // ErrorLocation is used for logging. It is the module + // identifier that produced the error. It should be one + // of client, middleware, endpoint. + ErrorLocation() string + // ErrorType is for error grouping. + ErrorType() ErrorType + // Unwrap to enable usage of func errors.As + Unwrap() error +} diff --git a/runtime/error_builder.go b/runtime/error_builder.go new file mode 100644 index 000000000..cde0a6a3b --- /dev/null +++ b/runtime/error_builder.go @@ -0,0 +1,81 @@ +package zanzibar + +import "go.uber.org/zap" + +const ( + logFieldErrorLocation = "errorLocation" + logFieldErrorType = "errorType" +) + +// ErrorBuilder provides useful functions to use Error. +type ErrorBuilder interface { + Error(err error, errType ErrorType) Error + LogFieldErrorLocation(err error) zap.Field + LogFieldErrorType(err error) zap.Field +} + +// NewErrorBuilder creates an instance of ErrorBuilder. +// Input module id is used as error location for Errors +// created by this builder. +// +// PseudoErrLocation is prefixed with "~" to identify +// logged error that is not created in the present module. +func NewErrorBuilder(moduleClassName, moduleName string) ErrorBuilder { + return zErrorBuilder{ + errLocation: moduleClassName + "::" + moduleName, + pseudoErrLocation: "~" + moduleClassName + "::" + moduleName, + } +} + +type zErrorBuilder struct { + errLocation, pseudoErrLocation string +} + +type zError struct { + error + errLocation string + errType ErrorType +} + +var _ Error = (*zError)(nil) +var _ ErrorBuilder = (*zErrorBuilder)(nil) + +func (zb zErrorBuilder) Error(err error, errType ErrorType) Error { + return zError{ + error: err, + errLocation: zb.errLocation, + errType: errType, + } +} + +func (zb zErrorBuilder) toError(err error) Error { + if zerr, ok := err.(Error); ok { + return zerr + } + return zError{ + error: err, + errLocation: zb.pseudoErrLocation, + } +} + +func (zb zErrorBuilder) LogFieldErrorLocation(err error) zap.Field { + zerr := zb.toError(err) + return zap.String(logFieldErrorLocation, zerr.ErrorLocation()) +} + +func (zb zErrorBuilder) LogFieldErrorType(err error) zap.Field { + zerr := zb.toError(err) + return zap.String(logFieldErrorType, zerr.ErrorType().String()) +} + +func (e zError) Unwrap() error { + return e.error +} + +func (e zError) ErrorLocation() string { + return e.errLocation +} + +func (e zError) ErrorType() ErrorType { + return e.errType +} diff --git a/runtime/errortype_string.go b/runtime/errortype_string.go new file mode 100644 index 000000000..bf30e8d28 --- /dev/null +++ b/runtime/errortype_string.go @@ -0,0 +1,26 @@ +// Code generated by "stringer -type=ErrorType"; DO NOT EDIT. + +package zanzibar + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[TChannelError-1] + _ = x[ClientException-2] + _ = x[BadResponse-3] +} + +const _ErrorType_name = "TChannelErrorClientExceptionBadResponse" + +var _ErrorType_index = [...]uint8{0, 13, 28, 39} + +func (i ErrorType) String() string { + i -= 1 + if i < 0 || i >= ErrorType(len(_ErrorType_index)-1) { + return "ErrorType(" + strconv.FormatInt(int64(i+1), 10) + ")" + } + return _ErrorType_name[_ErrorType_index[i]:_ErrorType_index[i+1]] +} From c164a265b7c315ab3d9c6cc639717e951855ce0e Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 26 Jun 2023 17:48:42 +0530 Subject: [PATCH 14/86] add ut --- runtime/error_builder_test.go | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 runtime/error_builder_test.go diff --git a/runtime/error_builder_test.go b/runtime/error_builder_test.go new file mode 100644 index 000000000..5f3c1cbe1 --- /dev/null +++ b/runtime/error_builder_test.go @@ -0,0 +1,51 @@ +package zanzibar_test + +import ( + "errors" + "go.uber.org/zap" + "strconv" + "testing" + + "github.com/stretchr/testify/assert" + zanzibar "github.com/uber/zanzibar/runtime" +) + +func TestErrorBuilder(t *testing.T) { + eb := zanzibar.NewErrorBuilder("endpoint", "foo") + err := errors.New("test error") + zerr := eb.Error(err, zanzibar.TChannelError) + + assert.Equal(t, "endpoint::foo", zerr.ErrorLocation()) + assert.Equal(t, "TChannelError", zerr.ErrorType().String()) + assert.True(t, errors.Is(zerr, err)) +} + +func TestErrorBuilderLogFields(t *testing.T) { + eb := zanzibar.NewErrorBuilder("client", "bar") + testErr := errors.New("test error") + table := []struct { + err error + wantErrLocation string + wantErrType string + }{ + { + err: eb.Error(testErr, zanzibar.ClientException), + wantErrLocation: "client::bar", + wantErrType: "ClientException", + }, + { + err: testErr, + wantErrLocation: "~client::bar", + wantErrType: "ErrorType(0)", + }, + } + for i, tt := range table { + t.Run("test"+strconv.Itoa(i), func(t *testing.T) { + logFieldErrLocation := eb.LogFieldErrorLocation(tt.err) + logFieldErrType := eb.LogFieldErrorType(tt.err) + + assert.Equal(t, zap.String("errorLocation", tt.wantErrLocation), logFieldErrLocation) + assert.Equal(t, zap.String("errorType", tt.wantErrType), logFieldErrType) + }) + } +} From c2a3ba91f5900ab144456680ab7e76a4522d4e1a Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 26 Jun 2023 18:00:10 +0530 Subject: [PATCH 15/86] add license --- runtime/error.go | 20 ++++++++++++++++++++ runtime/error_builder.go | 20 ++++++++++++++++++++ runtime/error_builder_test.go | 22 +++++++++++++++++++++- runtime/errortype_string.go | 20 ++++++++++++++++++++ 4 files changed, 81 insertions(+), 1 deletion(-) diff --git a/runtime/error.go b/runtime/error.go index 3b7e06493..919733129 100644 --- a/runtime/error.go +++ b/runtime/error.go @@ -1,3 +1,23 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zanzibar // ErrorType is used for error grouping. diff --git a/runtime/error_builder.go b/runtime/error_builder.go index cde0a6a3b..1cb0db7ac 100644 --- a/runtime/error_builder.go +++ b/runtime/error_builder.go @@ -1,3 +1,23 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zanzibar import "go.uber.org/zap" diff --git a/runtime/error_builder_test.go b/runtime/error_builder_test.go index 5f3c1cbe1..1954f5588 100644 --- a/runtime/error_builder_test.go +++ b/runtime/error_builder_test.go @@ -1,13 +1,33 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zanzibar_test import ( "errors" - "go.uber.org/zap" "strconv" "testing" "github.com/stretchr/testify/assert" zanzibar "github.com/uber/zanzibar/runtime" + "go.uber.org/zap" ) func TestErrorBuilder(t *testing.T) { diff --git a/runtime/errortype_string.go b/runtime/errortype_string.go index bf30e8d28..a27ff28db 100644 --- a/runtime/errortype_string.go +++ b/runtime/errortype_string.go @@ -1,3 +1,23 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + // Code generated by "stringer -type=ErrorType"; DO NOT EDIT. package zanzibar From 7b2a88872bf05f366a2012e81e167b19fbb532ff Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Tue, 27 Jun 2023 10:17:56 +0530 Subject: [PATCH 16/86] codegen --- codegen/template_bundle/template_files.go | 68 +- codegen/templates/endpoint.tmpl | 5 +- codegen/templates/tchannel_client.tmpl | 10 +- codegen/templates/workflow.tmpl | 31 +- .../example-gateway/build/clients/baz/baz.go | 190 +- .../build/clients/corge/corge.go | 8 +- .../bar/bar_bar_method_argnotstruct.go | 3 + .../bar/bar_bar_method_argwithheaders.go | 4 + .../bar_bar_method_argwithmanyqueryparams.go | 4 + ...ar_bar_method_argwithneardupqueryparams.go | 4 + ...bar_bar_method_argwithnestedqueryparams.go | 4 + .../bar/bar_bar_method_argwithparams.go | 4 + ..._method_argwithparamsandduplicatefields.go | 4 + .../bar/bar_bar_method_argwithqueryheader.go | 4 + .../bar/bar_bar_method_argwithqueryparams.go | 4 + .../bar/bar_bar_method_deletewithbody.go | 4 + .../bar/bar_bar_method_helloworld.go | 3 + .../bar/bar_bar_method_listandenum.go | 3 + .../bar/bar_bar_method_missingarg.go | 3 + .../endpoints/bar/bar_bar_method_norequest.go | 3 + .../endpoints/bar/bar_bar_method_normal.go | 3 + .../bar/bar_bar_method_toomanyargs.go | 3 + .../workflow/bar_bar_method_argnotstruct.go | 15 +- .../workflow/bar_bar_method_argwithheaders.go | 11 +- .../bar_bar_method_argwithmanyqueryparams.go | 11 +- ...ar_bar_method_argwithneardupqueryparams.go | 11 +- ...bar_bar_method_argwithnestedqueryparams.go | 11 +- .../workflow/bar_bar_method_argwithparams.go | 11 +- ..._method_argwithparamsandduplicatefields.go | 11 +- .../bar_bar_method_argwithqueryheader.go | 11 +- .../bar_bar_method_argwithqueryparams.go | 11 +- .../workflow/bar_bar_method_deletewithbody.go | 11 +- .../bar/workflow/bar_bar_method_helloworld.go | 19 +- .../workflow/bar_bar_method_listandenum.go | 15 +- .../bar/workflow/bar_bar_method_missingarg.go | 15 +- .../bar/workflow/bar_bar_method_norequest.go | 15 +- .../bar/workflow/bar_bar_method_normal.go | 15 +- .../workflow/bar_bar_method_toomanyargs.go | 19 +- .../baz/baz_simpleservice_method_call.go | 3 + .../baz/baz_simpleservice_method_compare.go | 3 + .../baz_simpleservice_method_getprofile.go | 3 + .../baz_simpleservice_method_headerschema.go | 3 + .../baz/baz_simpleservice_method_ping.go | 4 + .../baz/baz_simpleservice_method_sillynoop.go | 3 + .../baz/baz_simpleservice_method_trans.go | 3 + .../baz_simpleservice_method_transheaders.go | 3 + ..._simpleservice_method_transheadersnoreq.go | 3 + ...z_simpleservice_method_transheaderstype.go | 3 + .../workflow/baz_simpleservice_method_call.go | 15 +- .../baz_simpleservice_method_compare.go | 19 +- .../baz_simpleservice_method_getprofile.go | 15 +- .../baz_simpleservice_method_headerschema.go | 19 +- .../workflow/baz_simpleservice_method_ping.go | 11 +- .../baz_simpleservice_method_sillynoop.go | 19 +- .../baz_simpleservice_method_trans.go | 19 +- .../baz_simpleservice_method_transheaders.go | 19 +- ..._simpleservice_method_transheadersnoreq.go | 15 +- ...z_simpleservice_method_transheaderstype.go | 19 +- .../clientless_clientless_method_beta.go | 4 + ...entless_method_clientlessargwithheaders.go | 4 + ...lientless_method_emptyclientlessrequest.go | 4 + .../contacts_contacts_method_savecontacts.go | 3 + ...oglenow_googlenow_method_addcredentials.go | 4 + ...lenow_googlenow_method_checkcredentials.go | 4 + ...oglenow_googlenow_method_addcredentials.go | 11 +- ...lenow_googlenow_method_checkcredentials.go | 11 +- .../multi/multi_serviceafront_method_hello.go | 4 + .../multi/multi_servicebfront_method_hello.go | 4 + .../multi_serviceafront_method_hello.go | 11 +- .../multi_servicebfront_method_hello.go | 11 +- .../panic/panic_servicecfront_method_hello.go | 4 + ...hexceptions_withexceptions_method_func1.go | 3 + ...hexceptions_withexceptions_method_func1.go | 19 +- .../clients-idl/clients/bar/bar/bar.go | 2738 ++++++++--------- .../clients-idl/clients/baz/base/base.go | 224 +- .../clients-idl/clients/baz/baz/baz.go | 2250 +++++++------- .../clients/contacts/contacts/contacts.go | 354 +-- .../clients-idl/clients/corge/corge/corge.go | 386 +-- .../clients-idl/clients/echo/echo.pb.yarpc.go | 16 +- .../clients-idl/clients/foo/base/base/base.go | 32 +- .../clients-idl/clients/foo/foo/foo.go | 96 +- .../clients/googlenow/googlenow/googlenow.go | 130 +- .../clients-idl/clients/multi/multi/multi.go | 194 +- .../withexceptions/withexceptions.go | 160 +- .../endpoints/app/demo/endpoints/abc/abc.go | 64 +- .../endpoints-idl/endpoints/bar/bar/bar.go | 1426 ++++----- .../endpoints-idl/endpoints/baz/baz/baz.go | 1314 ++++---- .../endpoints/bounce/bounce/bounce.go | 64 +- .../clientless/clientless/clientless.go | 258 +- .../endpoints/contacts/contacts/contacts.go | 354 +-- .../endpoints/foo/base/base/base.go | 32 +- .../endpoints-idl/endpoints/foo/foo/foo.go | 96 +- .../googlenow/googlenow/googlenow.go | 130 +- .../endpoints/models/meta/meta.go | 224 +- .../endpoints/multi/multi/multi.go | 194 +- .../endpoints/tchannel/baz/baz/baz.go | 514 ++-- .../endpoints/tchannel/echo/echo/echo.go | 64 +- .../endpoints/tchannel/quux/quux/quux.go | 64 +- .../withexceptions/withexceptions.go | 160 +- .../build/gen-code/clients/bar/bar/bar.go | 2642 ++++++++-------- .../gen-code/clients/foo/base/base/base.go | 32 +- .../build/gen-code/clients/foo/foo/foo.go | 96 +- .../endpoints/bounce/bounce/bounce.go | 64 +- .../endpoints/tchannel/echo/echo/echo.go | 64 +- .../proto-gen/clients/echo/echo.pb.yarpc.go | 32 +- .../clients/mirror/mirror.pb.yarpc.go | 32 +- runtime/error.go | 16 +- runtime/error_builder.go | 65 +- runtime/error_builder_test.go | 42 +- 109 files changed, 7937 insertions(+), 7569 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 4afe34ffd..164f2ac98 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -641,7 +641,10 @@ func (h *{{$handlerName}}) HandleRequest( } if err != nil { - {{- if eq (len .Exceptions) 0 -}} + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + {{if eq (len .Exceptions) 0}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} @@ -702,7 +705,7 @@ func endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "endpoint.tmpl", size: 7963, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "endpoint.tmpl", size: 8030, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2778,7 +2781,7 @@ func mainTmpl() (*asset, error) { return a, nil } -var _main_testTmpl = []byte(`{{- /* template to render gateway main_test.go +var _main_testTmpl = []byte(`{{- /* template to render gateway main_test.go This template is the test entrypoint for spawning a gateway as a child process using the test coverage features etc. */ -}} @@ -3780,6 +3783,7 @@ func {{$exportName}}(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -3880,6 +3884,7 @@ type {{$clientName}} struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } {{range $svc := .Services}} @@ -3936,12 +3941,14 @@ type {{$clientName}} struct { err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { {{range .Exceptions -}} case result.{{title .Name}} != nil: - err = result.{{title .Name}} + err = c.errorBuilder.Error(result.{{title .Name}}, zanzibar.ClientException) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -3950,6 +3957,7 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -3966,6 +3974,7 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -3986,7 +3995,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 15721, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16278, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4401,7 +4410,7 @@ func tchannel_endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9430, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9370, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4503,6 +4512,7 @@ func New{{$workflowInterface}}(deps *module.Dependencies) {{$workflowInterface}} Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -4512,6 +4522,7 @@ type {{$workflowStruct}} struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -4636,34 +4647,31 @@ func (w {{$workflowStruct}}) Handle( {{- $responseType := .ResponseType }} if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { {{range $idx, $cException := $clientExceptions}} case *{{$cException.Type}}: - serverErr := convert{{$methodName}}{{title $cException.Name}}( + err = convert{{$methodName}}{{title $cException.Name}}( errValue, ) - {{if eq $responseType ""}} - return ctx, nil, serverErr - {{else if eq $responseType "string" }} - return ctx, "", nil, serverErr - {{else}} - return ctx, nil, nil, serverErr - {{end}} {{end}} default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "{{$clientName}}"), ) - - {{if eq $responseType ""}} - return ctx, nil, err - {{else if eq $responseType "string" }} - return ctx, "", nil, err - {{else}} - return ctx, nil, nil, err - {{end}} } + err = w.errorBuilder.Rebuild(zErr, err) + {{if eq $responseType ""}} + return ctx, nil, err + {{else if eq $responseType "string" }} + return ctx, "", nil, err + {{else}} + return ctx, nil, nil, err + {{end}} } // Filter and map response headers from client to server response. @@ -4738,7 +4746,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10454, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10619, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -5006,13 +5014,11 @@ var _bindata = map[string]func() (*asset, error){ // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: -// -// data/ -// foo.txt -// img/ -// a.png -// b.png -// +// data/ +// foo.txt +// img/ +// a.png +// b.png // then AssetDir("data") would return []string{"foo.txt", "img"} // AssetDir("data/img") would return []string{"a.png", "b.png"} // AssetDir("foo.txt") and AssetDir("notexist") would return an error diff --git a/codegen/templates/endpoint.tmpl b/codegen/templates/endpoint.tmpl index 6ec0a9262..aaa7f97fa 100644 --- a/codegen/templates/endpoint.tmpl +++ b/codegen/templates/endpoint.tmpl @@ -217,7 +217,10 @@ func (h *{{$handlerName}}) HandleRequest( } if err != nil { - {{- if eq (len .Exceptions) 0 -}} + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + {{if eq (len .Exceptions) 0}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index 46441f135..c71032147 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -223,6 +223,7 @@ func {{$exportName}}(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -323,6 +324,7 @@ type {{$clientName}} struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } {{range $svc := .Services}} @@ -379,12 +381,14 @@ type {{$clientName}} struct { err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { {{range .Exceptions -}} case result.{{title .Name}} != nil: - err = result.{{title .Name}} + err = c.errorBuilder.Error(result.{{title .Name}}, zanzibar.ClientException) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -393,6 +397,7 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -409,6 +414,7 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err diff --git a/codegen/templates/workflow.tmpl b/codegen/templates/workflow.tmpl index accb8bffc..f11337c90 100644 --- a/codegen/templates/workflow.tmpl +++ b/codegen/templates/workflow.tmpl @@ -95,6 +95,7 @@ func New{{$workflowInterface}}(deps *module.Dependencies) {{$workflowInterface}} Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -104,6 +105,7 @@ type {{$workflowStruct}} struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -228,34 +230,31 @@ func (w {{$workflowStruct}}) Handle( {{- $responseType := .ResponseType }} if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { {{range $idx, $cException := $clientExceptions}} case *{{$cException.Type}}: - serverErr := convert{{$methodName}}{{title $cException.Name}}( + err = convert{{$methodName}}{{title $cException.Name}}( errValue, ) - {{if eq $responseType ""}} - return ctx, nil, serverErr - {{else if eq $responseType "string" }} - return ctx, "", nil, serverErr - {{else}} - return ctx, nil, nil, serverErr - {{end}} {{end}} default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "{{$clientName}}"), ) - - {{if eq $responseType ""}} - return ctx, nil, err - {{else if eq $responseType "string" }} - return ctx, "", nil, err - {{else}} - return ctx, nil, nil, err - {{end}} } + err = w.errorBuilder.Rebuild(zErr, err) + {{if eq $responseType ""}} + return ctx, nil, err + {{else if eq $responseType "string" }} + return ctx, "", nil, err + {{else}} + return ctx, nil, nil, err + {{end}} } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/clients/baz/baz.go b/examples/example-gateway/build/clients/baz/baz.go index 5633c8c74..987339520 100644 --- a/examples/example-gateway/build/clients/baz/baz.go +++ b/examples/example-gateway/build/clients/baz/baz.go @@ -387,6 +387,7 @@ func NewClient(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("client", "baz"), } } @@ -487,6 +488,7 @@ type bazClient struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // EchoBinary is a client RPC call for method "SecondService::echoBinary" @@ -531,7 +533,9 @@ func (c *bazClient) EchoBinary( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -539,6 +543,7 @@ func (c *bazClient) EchoBinary( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBinary") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -548,6 +553,7 @@ func (c *bazClient) EchoBinary( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBinary_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -595,7 +601,9 @@ func (c *bazClient) EchoBool( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -603,6 +611,7 @@ func (c *bazClient) EchoBool( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBool") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -612,6 +621,7 @@ func (c *bazClient) EchoBool( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBool_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -659,7 +669,9 @@ func (c *bazClient) EchoDouble( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -667,6 +679,7 @@ func (c *bazClient) EchoDouble( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoDouble") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -676,6 +689,7 @@ func (c *bazClient) EchoDouble( resp, err = clientsIDlClientsBazBaz.SecondService_EchoDouble_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -723,7 +737,9 @@ func (c *bazClient) EchoEnum( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -731,6 +747,7 @@ func (c *bazClient) EchoEnum( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoEnum") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -740,6 +757,7 @@ func (c *bazClient) EchoEnum( resp, err = clientsIDlClientsBazBaz.SecondService_EchoEnum_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -787,7 +805,9 @@ func (c *bazClient) EchoI16( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -795,6 +815,7 @@ func (c *bazClient) EchoI16( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI16") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -804,6 +825,7 @@ func (c *bazClient) EchoI16( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI16_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -851,7 +873,9 @@ func (c *bazClient) EchoI32( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -859,6 +883,7 @@ func (c *bazClient) EchoI32( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI32") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -868,6 +893,7 @@ func (c *bazClient) EchoI32( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI32_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -915,7 +941,9 @@ func (c *bazClient) EchoI64( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -923,6 +951,7 @@ func (c *bazClient) EchoI64( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI64") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -932,6 +961,7 @@ func (c *bazClient) EchoI64( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI64_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -979,7 +1009,9 @@ func (c *bazClient) EchoI8( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -987,6 +1019,7 @@ func (c *bazClient) EchoI8( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI8") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -996,6 +1029,7 @@ func (c *bazClient) EchoI8( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI8_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1043,7 +1077,9 @@ func (c *bazClient) EchoString( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1051,6 +1087,7 @@ func (c *bazClient) EchoString( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoString") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1060,6 +1097,7 @@ func (c *bazClient) EchoString( resp, err = clientsIDlClientsBazBaz.SecondService_EchoString_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1107,7 +1145,9 @@ func (c *bazClient) EchoStringList( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1115,6 +1155,7 @@ func (c *bazClient) EchoStringList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringList") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1124,6 +1165,7 @@ func (c *bazClient) EchoStringList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringList_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1171,7 +1213,9 @@ func (c *bazClient) EchoStringMap( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1179,6 +1223,7 @@ func (c *bazClient) EchoStringMap( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringMap") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1188,6 +1233,7 @@ func (c *bazClient) EchoStringMap( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringMap_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1235,7 +1281,9 @@ func (c *bazClient) EchoStringSet( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1243,6 +1291,7 @@ func (c *bazClient) EchoStringSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringSet") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1252,6 +1301,7 @@ func (c *bazClient) EchoStringSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringSet_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1299,7 +1349,9 @@ func (c *bazClient) EchoStructList( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1307,6 +1359,7 @@ func (c *bazClient) EchoStructList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructList") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1316,6 +1369,7 @@ func (c *bazClient) EchoStructList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructList_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1363,7 +1417,9 @@ func (c *bazClient) EchoStructSet( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1371,6 +1427,7 @@ func (c *bazClient) EchoStructSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructSet") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1380,6 +1437,7 @@ func (c *bazClient) EchoStructSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructSet_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1427,7 +1485,9 @@ func (c *bazClient) EchoTypedef( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1435,6 +1495,7 @@ func (c *bazClient) EchoTypedef( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoTypedef") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1444,6 +1505,7 @@ func (c *bazClient) EchoTypedef( resp, err = clientsIDlClientsBazBaz.SecondService_EchoTypedef_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1490,13 +1552,16 @@ func (c *bazClient) Call( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) default: err = errors.New("bazClient received no result or unknown exception for Call") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1549,18 +1614,21 @@ func (c *bazClient) Compare( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Compare. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for Compare") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1570,6 +1638,7 @@ func (c *bazClient) Compare( resp, err = clientsIDlClientsBazBaz.SimpleService_Compare_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1617,16 +1686,19 @@ func (c *bazClient) GetProfile( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for GetProfile") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1636,6 +1708,7 @@ func (c *bazClient) GetProfile( resp, err = clientsIDlClientsBazBaz.SimpleService_GetProfile_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1683,18 +1756,21 @@ func (c *bazClient) HeaderSchema( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for HeaderSchema") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1704,6 +1780,7 @@ func (c *bazClient) HeaderSchema( resp, err = clientsIDlClientsBazBaz.SimpleService_HeaderSchema_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1751,7 +1828,9 @@ func (c *bazClient) Ping( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -1759,6 +1838,7 @@ func (c *bazClient) Ping( success = true default: err = errors.New("bazClient received no result or unknown exception for Ping") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1768,6 +1848,7 @@ func (c *bazClient) Ping( resp, err = clientsIDlClientsBazBaz.SimpleService_Ping_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1814,15 +1895,18 @@ func (c *bazClient) DeliberateDiffNoop( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.ServerErr != nil: - err = result.ServerErr + err = c.errorBuilder.Error(result.ServerErr, zanzibar.ClientException) default: err = errors.New("bazClient received no result or unknown exception for SillyNoop") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1874,11 +1958,14 @@ func (c *bazClient) TestUUID( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { default: err = errors.New("bazClient received no result or unknown exception for TestUuid") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1931,18 +2018,21 @@ func (c *bazClient) Trans( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Trans. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for Trans") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1952,6 +2042,7 @@ func (c *bazClient) Trans( resp, err = clientsIDlClientsBazBaz.SimpleService_Trans_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1999,18 +2090,21 @@ func (c *bazClient) TransHeaders( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeaders") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2020,6 +2114,7 @@ func (c *bazClient) TransHeaders( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeaders_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2067,16 +2162,19 @@ func (c *bazClient) TransHeadersNoReq( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersNoReq") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2086,6 +2184,7 @@ func (c *bazClient) TransHeadersNoReq( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersNoReq_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2133,18 +2232,21 @@ func (c *bazClient) TransHeadersType( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.AuthErr != nil: - err = result.AuthErr + err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.OtherAuthErr != nil: - err = result.OtherAuthErr + err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersType") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2154,6 +2256,7 @@ func (c *bazClient) TransHeadersType( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersType_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2200,11 +2303,14 @@ func (c *bazClient) URLTest( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { default: err = errors.New("bazClient received no result or unknown exception for UrlTest") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { diff --git a/examples/example-gateway/build/clients/corge/corge.go b/examples/example-gateway/build/clients/corge/corge.go index 5c16a9986..f91767440 100644 --- a/examples/example-gateway/build/clients/corge/corge.go +++ b/examples/example-gateway/build/clients/corge/corge.go @@ -206,6 +206,7 @@ func NewClient(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("client", "corge"), } } @@ -306,6 +307,7 @@ type corgeClient struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // EchoString is a client RPC call for method "Corge::echoString" @@ -350,7 +352,9 @@ func (c *corgeClient) EchoString( err = clientErr } } - + if err != nil { + err = c.errorBuilder.Error(err, zanzibar.TChannelError) + } if err == nil && !success { switch { case result.Success != nil: @@ -358,6 +362,7 @@ func (c *corgeClient) EchoString( success = true default: err = errors.New("corgeClient received no result or unknown exception for EchoString") + err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -367,6 +372,7 @@ func (c *corgeClient) EchoString( resp, err = clientsIDlClientsCorgeCorge.Corge_EchoString_Helper.UnwrapResponse(&result) if err != nil { + err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go index 855c09001..8cdf41e5b 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go @@ -142,6 +142,9 @@ func (h *BarArgNotStructHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go index d273b2656..dd1cc0868 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go @@ -173,6 +173,10 @@ func (h *BarArgWithHeadersHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go index e94ce9494..eb98461a2 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go @@ -476,6 +476,10 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go index 584383952..e0d99324d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go @@ -199,6 +199,10 @@ func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go index d3fc928a5..fac805b6d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go @@ -255,6 +255,10 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go index 0995c7f78..bba729ca8 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go @@ -170,6 +170,10 @@ func (h *BarArgWithParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go index 40770cde2..c0aacea40 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go @@ -166,6 +166,10 @@ func (h *BarArgWithParamsAndDuplicateFieldsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go index 24a31a683..cc14126f1 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go @@ -167,6 +167,10 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go index 2776ae988..7508f0b51 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go @@ -200,6 +200,10 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go index e775dc4f6..8e4daed0d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go @@ -142,6 +142,10 @@ func (h *BarDeleteWithBodyHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go index 62fe2c6ed..630cb8a5c 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go @@ -136,6 +136,9 @@ func (h *BarHelloWorldHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go index d1afeb485..84f8eaa17 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go @@ -206,6 +206,9 @@ func (h *BarListAndEnumHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go index fc72eac8f..b0481eb7d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go @@ -135,6 +135,9 @@ func (h *BarMissingArgHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go index 66b993bb8..21f06d638 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go @@ -135,6 +135,9 @@ func (h *BarNoRequestHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go index 619fccae3..a66bd2321 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go @@ -171,6 +171,9 @@ func (h *BarNormalHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go index 34eff269c..04694bfa2 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go @@ -165,6 +165,9 @@ func (h *BarTooManyArgsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go index 7812ae8d0..ad30f2855 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go @@ -63,6 +63,7 @@ func NewBarArgNotStructWorkflow(deps *module.Dependencies) BarArgNotStructWorkfl Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgNotStructWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,24 +132,27 @@ func (w barArgNotStructWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertArgNotStructBarException( + err = convertArgNotStructBarException( errValue, ) - return ctx, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go index 36ccbc735..6c493321f 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go @@ -63,6 +63,7 @@ func NewBarArgWithHeadersWorkflow(deps *module.Dependencies) BarArgWithHeadersWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithHeadersWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -134,6 +136,10 @@ func (w barArgWithHeadersWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -141,10 +147,11 @@ func (w barArgWithHeadersWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go index 77c414f32..80cc920b2 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go @@ -63,6 +63,7 @@ func NewBarArgWithManyQueryParamsWorkflow(deps *module.Dependencies) BarArgWithM Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithManyQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,6 +132,10 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -137,10 +143,11 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go index e2a98a4c8..3cab5d5bc 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go @@ -63,6 +63,7 @@ func NewBarArgWithNearDupQueryParamsWorkflow(deps *module.Dependencies) BarArgWi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithNearDupQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,6 +132,10 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -137,10 +143,11 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go index c4734cd53..47ab83355 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go @@ -63,6 +63,7 @@ func NewBarArgWithNestedQueryParamsWorkflow(deps *module.Dependencies) BarArgWit Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithNestedQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,6 +132,10 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -137,10 +143,11 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go index b6a9b6b4c..1918aa27c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go @@ -63,6 +63,7 @@ func NewBarArgWithParamsWorkflow(deps *module.Dependencies) BarArgWithParamsWork Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,6 +132,10 @@ func (w barArgWithParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -137,10 +143,11 @@ func (w barArgWithParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go index 4ef022d94..6e3692b68 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go @@ -63,6 +63,7 @@ func NewBarArgWithParamsAndDuplicateFieldsWorkflow(deps *module.Dependencies) Ba Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithParamsAndDuplicateFieldsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,6 +132,10 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -137,10 +143,11 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go index bf13ff19c..938c91a0a 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go @@ -63,6 +63,7 @@ func NewBarArgWithQueryHeaderWorkflow(deps *module.Dependencies) BarArgWithQuery Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithQueryHeaderWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,6 +132,10 @@ func (w barArgWithQueryHeaderWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -137,10 +143,11 @@ func (w barArgWithQueryHeaderWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go index b087eeaa9..1336eb278 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go @@ -63,6 +63,7 @@ func NewBarArgWithQueryParamsWorkflow(deps *module.Dependencies) BarArgWithQuery Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barArgWithQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -138,6 +140,10 @@ func (w barArgWithQueryParamsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -145,10 +151,11 @@ func (w barArgWithQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go index 9752a7354..e7196ddd6 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go @@ -63,6 +63,7 @@ func NewBarDeleteWithBodyWorkflow(deps *module.Dependencies) BarDeleteWithBodyWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barDeleteWithBodyWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,6 +132,10 @@ func (w barDeleteWithBodyWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -137,10 +143,11 @@ func (w barDeleteWithBodyWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go index c088df026..8e05edc47 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go @@ -62,6 +62,7 @@ func NewBarHelloWorldWorkflow(deps *module.Dependencies) BarHelloWorldWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -71,6 +72,7 @@ type barHelloWorldWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -127,31 +129,32 @@ func (w barHelloWorldWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertHelloWorldBarException( + err = convertHelloWorldBarException( errValue, ) - return ctx, "", nil, serverErr - case *clientsIDlClientsBarBar.SeeOthersRedirection: - serverErr := convertHelloWorldSeeOthersRedirection( + err = convertHelloWorldSeeOthersRedirection( errValue, ) - return ctx, "", nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err + return ctx, "", nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go index 70ec1fcbe..ea1bfd142 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go @@ -63,6 +63,7 @@ func NewBarListAndEnumWorkflow(deps *module.Dependencies) BarListAndEnumWorkflow Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barListAndEnumWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,24 +132,27 @@ func (w barListAndEnumWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertListAndEnumBarException( + err = convertListAndEnumBarException( errValue, ) - return ctx, "", nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err + return ctx, "", nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go index a3a4f6b50..fda757258 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go @@ -62,6 +62,7 @@ func NewBarMissingArgWorkflow(deps *module.Dependencies) BarMissingArgWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -71,6 +72,7 @@ type barMissingArgWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -127,24 +129,27 @@ func (w barMissingArgWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertMissingArgBarException( + err = convertMissingArgBarException( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go index 25404a7c8..b51c7d56e 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go @@ -62,6 +62,7 @@ func NewBarNoRequestWorkflow(deps *module.Dependencies) BarNoRequestWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -71,6 +72,7 @@ type barNoRequestWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -127,24 +129,27 @@ func (w barNoRequestWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertNoRequestBarException( + err = convertNoRequestBarException( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go index 6758537f0..ea1c01223 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go @@ -63,6 +63,7 @@ func NewBarNormalWorkflow(deps *module.Dependencies) BarNormalWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,6 +73,7 @@ type barNormalWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,24 +132,27 @@ func (w barNormalWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertNormalBarException( + err = convertNormalBarException( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go index 41bcffec6..522a121a8 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go @@ -66,6 +66,7 @@ func NewBarTooManyArgsWorkflow(deps *module.Dependencies) BarTooManyArgsWorkflow Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -75,6 +76,7 @@ type barTooManyArgsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -141,31 +143,32 @@ func (w barTooManyArgsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - serverErr := convertTooManyArgsBarException( + err = convertTooManyArgsBarException( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsFooFoo.FooException: - serverErr := convertTooManyArgsFooException( + err = convertTooManyArgsFooException( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go index 3d0e9cdcb..42ec6b084 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go @@ -157,6 +157,9 @@ func (h *SimpleServiceCallHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go index db84a6945..853f4f76e 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go @@ -164,6 +164,9 @@ func (h *SimpleServiceCompareHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go index c78889b4b..1539f345e 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go @@ -164,6 +164,9 @@ func (h *SimpleServiceGetProfileHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go index f1970b89d..2eff4135e 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go @@ -167,6 +167,9 @@ func (h *SimpleServiceHeaderSchemaHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go index 7e2d511d9..410cf0d7d 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go @@ -134,6 +134,10 @@ func (h *SimpleServicePingHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go index 1e6608132..8038f07f1 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go @@ -135,6 +135,9 @@ func (h *SimpleServiceSillyNoopHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go index 8fb8f2ffc..cb6e0f008 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go @@ -164,6 +164,9 @@ func (h *SimpleServiceTransHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go index c9ebb54e6..6df2f9dbc 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go @@ -164,6 +164,9 @@ func (h *SimpleServiceTransHeadersHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go index 8fcf59ddd..741177811 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go @@ -139,6 +139,9 @@ func (h *SimpleServiceTransHeadersNoReqHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go index 6bf50bff2..8f8ab06ff 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go @@ -164,6 +164,9 @@ func (h *SimpleServiceTransHeadersTypeHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go index 6da3706be..46669a571 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go @@ -63,6 +63,7 @@ func NewSimpleServiceCallWorkflow(deps *module.Dependencies) SimpleServiceCallWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,6 +73,7 @@ type simpleServiceCallWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -138,24 +140,27 @@ func (w simpleServiceCallWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertCallAuthErr( + err = convertCallAuthErr( errValue, ) - return ctx, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go index 9d81f5ed8..ba248ccb5 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go @@ -64,6 +64,7 @@ func NewSimpleServiceCompareWorkflow(deps *module.Dependencies) SimpleServiceCom Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceCompareWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -131,31 +133,32 @@ func (w simpleServiceCompareWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertCompareAuthErr( + err = convertCompareAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertCompareOtherAuthErr( + err = convertCompareOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go index 2bffcecc1..cd701ce34 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go @@ -63,6 +63,7 @@ func NewSimpleServiceGetProfileWorkflow(deps *module.Dependencies) SimpleService Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,6 +73,7 @@ type simpleServiceGetProfileWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,24 +132,27 @@ func (w simpleServiceGetProfileWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertGetProfileAuthErr( + err = convertGetProfileAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go index 570ca0ed3..610f9b36b 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go @@ -63,6 +63,7 @@ func NewSimpleServiceHeaderSchemaWorkflow(deps *module.Dependencies) SimpleServi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,6 +73,7 @@ type simpleServiceHeaderSchemaWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -146,31 +148,32 @@ func (w simpleServiceHeaderSchemaWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertHeaderSchemaAuthErr( + err = convertHeaderSchemaAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertHeaderSchemaOtherAuthErr( + err = convertHeaderSchemaOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go index 7aa626ef7..1c02751e2 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go @@ -62,6 +62,7 @@ func NewSimpleServicePingWorkflow(deps *module.Dependencies) SimpleServicePingWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -71,6 +72,7 @@ type simpleServicePingWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -127,6 +129,10 @@ func (w simpleServicePingWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -134,10 +140,11 @@ func (w simpleServicePingWorkflow) Handle( zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go index af344b1c8..105c5de4c 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go @@ -63,6 +63,7 @@ func NewSimpleServiceSillyNoopWorkflow(deps *module.Dependencies) SimpleServiceS Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,6 +73,7 @@ type simpleServiceSillyNoopWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -126,31 +128,32 @@ func (w simpleServiceSillyNoopWorkflow) Handle( ctx, _, err := w.Clients.Baz.DeliberateDiffNoop(ctx, clientHeaders) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertSillyNoopAuthErr( + err = convertSillyNoopAuthErr( errValue, ) - return ctx, nil, serverErr - case *clientsIDlClientsBazBase.ServerErr: - serverErr := convertSillyNoopServerErr( + err = convertSillyNoopServerErr( errValue, ) - return ctx, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go index 8cb5a69b6..5cc5b6d54 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go @@ -64,6 +64,7 @@ func NewSimpleServiceTransWorkflow(deps *module.Dependencies) SimpleServiceTrans Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceTransWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -131,31 +133,32 @@ func (w simpleServiceTransWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertTransAuthErr( + err = convertTransAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertTransOtherAuthErr( + err = convertTransOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go index 992033573..e3f915461 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go @@ -64,6 +64,7 @@ func NewSimpleServiceTransHeadersWorkflow(deps *module.Dependencies) SimpleServi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceTransHeadersWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -140,31 +142,32 @@ func (w simpleServiceTransHeadersWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertTransHeadersAuthErr( + err = convertTransHeadersAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertTransHeadersOtherAuthErr( + err = convertTransHeadersOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go index f038a6861..d65fa83f3 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go @@ -64,6 +64,7 @@ func NewSimpleServiceTransHeadersNoReqWorkflow(deps *module.Dependencies) Simple Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceTransHeadersNoReqWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -142,24 +144,27 @@ func (w simpleServiceTransHeadersNoReqWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertTransHeadersNoReqAuthErr( + err = convertTransHeadersNoReqAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go index 4bc9b3342..b7882354a 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go @@ -64,6 +64,7 @@ func NewSimpleServiceTransHeadersTypeWorkflow(deps *module.Dependencies) SimpleS Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,6 +74,7 @@ type simpleServiceTransHeadersTypeWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,31 +134,32 @@ func (w simpleServiceTransHeadersTypeWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - serverErr := convertTransHeadersTypeAuthErr( + err = convertTransHeadersTypeAuthErr( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsBazBaz.OtherAuthErr: - serverErr := convertTransHeadersTypeOtherAuthErr( + err = convertTransHeadersTypeOtherAuthErr( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go index a052eafc3..728cb69b5 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go @@ -164,6 +164,10 @@ func (h *ClientlessBetaHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go index f434247d9..b832d5e80 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go @@ -175,6 +175,10 @@ func (h *ClientlessClientlessArgWithHeadersHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go index 63394ef53..fe8c447a9 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go @@ -149,6 +149,10 @@ func (h *ClientlessEmptyclientlessRequestHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go b/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go index 1e140d3ab..3d2b5b181 100644 --- a/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go +++ b/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go @@ -169,6 +169,9 @@ func (h *ContactsSaveContactsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch err.(type) { diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go index 2d79f430e..64c8d4e29 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go @@ -145,6 +145,10 @@ func (h *GoogleNowAddCredentialsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go index 1f22547b0..08022c5e9 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go @@ -138,6 +138,10 @@ func (h *GoogleNowCheckCredentialsHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go index debfafbb0..c9c028780 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go @@ -63,6 +63,7 @@ func NewGoogleNowAddCredentialsWorkflow(deps *module.Dependencies) GoogleNowAddC Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "googlenow"), } } @@ -72,6 +73,7 @@ type googleNowAddCredentialsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -138,6 +140,10 @@ func (w googleNowAddCredentialsWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -145,10 +151,11 @@ func (w googleNowAddCredentialsWorkflow) Handle( zap.Error(errValue), zap.String("client", "GoogleNow"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go index 9c3d26db3..ec2916bec 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go @@ -59,6 +59,7 @@ func NewGoogleNowCheckCredentialsWorkflow(deps *module.Dependencies) GoogleNowCh Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "googlenow"), } } @@ -68,6 +69,7 @@ type googleNowCheckCredentialsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -130,6 +132,10 @@ func (w googleNowCheckCredentialsWorkflow) Handle( ctx, cliRespHeaders, err := w.Clients.GoogleNow.CheckCredentials(ctx, clientHeaders) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -137,10 +143,11 @@ func (w googleNowCheckCredentialsWorkflow) Handle( zap.Error(errValue), zap.String("client", "GoogleNow"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err + return ctx, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go index a9fc12109..8aa679135 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go @@ -135,6 +135,10 @@ func (h *ServiceAFrontHelloHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go index d598e6543..b54960d0c 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go @@ -135,6 +135,10 @@ func (h *ServiceBFrontHelloHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go index dffd383d4..7f448f2d8 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go @@ -59,6 +59,7 @@ func NewServiceAFrontHelloWorkflow(deps *module.Dependencies) ServiceAFrontHello Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "multi"), } } @@ -68,6 +69,7 @@ type serviceAFrontHelloWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -124,6 +126,10 @@ func (w serviceAFrontHelloWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -131,10 +137,11 @@ func (w serviceAFrontHelloWorkflow) Handle( zap.Error(errValue), zap.String("client", "Multi"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err + return ctx, "", nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go index 9366d1a18..03d854b07 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go @@ -59,6 +59,7 @@ func NewServiceBFrontHelloWorkflow(deps *module.Dependencies) ServiceBFrontHello Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "multi"), } } @@ -68,6 +69,7 @@ type serviceBFrontHelloWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -124,6 +126,10 @@ func (w serviceBFrontHelloWorkflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { default: @@ -131,10 +137,11 @@ func (w serviceBFrontHelloWorkflow) Handle( zap.Error(errValue), zap.String("client", "Multi"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err + return ctx, "", nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go index 31f2268e1..c0f36197f 100644 --- a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go @@ -135,6 +135,10 @@ func (h *ServiceCFrontHelloHandler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } + res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go index 329ec6c5b..81111d606 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go @@ -135,6 +135,9 @@ func (h *WithExceptionsFunc1Handler) HandleRequest( } if err != nil { + if zErr, ok := err.(zanzibar.Error); ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go index 9fe3d29e3..73fc3817d 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go @@ -62,6 +62,7 @@ func NewWithExceptionsFunc1Workflow(deps *module.Dependencies) WithExceptionsFun Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, + errorBuilder: zanzibar.NewErrorBuilder("endpoint", "withexceptions"), } } @@ -71,6 +72,7 @@ type withExceptionsFunc1Workflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies + errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -127,31 +129,32 @@ func (w withExceptionsFunc1Workflow) Handle( ) if err != nil { + zErr, ok := err.(zanzibar.Error) + if ok { + err = zErr.Unwrap() + } switch errValue := err.(type) { case *clientsIDlClientsWithexceptionsWithexceptions.ExceptionType1: - serverErr := convertFunc1E1( + err = convertFunc1E1( errValue, ) - return ctx, nil, nil, serverErr - case *clientsIDlClientsWithexceptionsWithexceptions.ExceptionType2: - serverErr := convertFunc1E2( + err = convertFunc1E2( errValue, ) - return ctx, nil, nil, serverErr - default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Withexceptions"), ) + } + err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err + return ctx, nil, nil, err - } } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go b/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go index ccad0769e..bda3ba24c 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -781,14 +781,14 @@ type BarRequestRecur struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequestRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -828,16 +828,16 @@ func _BarRequestRecur_Read(w wire.Value) (*BarRequestRecur, error) { // An error is returned if we were unable to build a BarRequestRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequestRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequestRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequestRecur) FromWire(w wire.Value) error { var err error @@ -1132,14 +1132,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1282,16 +1282,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1994,14 +1994,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponseRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2052,16 +2052,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a BarResponseRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponseRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponseRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponseRecur) FromWire(w wire.Value) error { var err error @@ -2358,8 +2358,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -2416,10 +2416,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2436,16 +2436,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -2453,13 +2453,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2557,8 +2557,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -2615,10 +2615,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2635,16 +2635,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -2652,13 +2652,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2797,14 +2797,14 @@ type OptionalParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2832,16 +2832,16 @@ func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OptionalParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OptionalParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OptionalParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OptionalParamsStruct) FromWire(w wire.Value) error { var err error @@ -3017,14 +3017,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3050,16 +3050,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -3224,14 +3224,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -3281,16 +3281,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -3621,14 +3621,14 @@ type QueryParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -3685,16 +3685,16 @@ func (v *QueryParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -4078,14 +4078,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4127,16 +4127,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -4354,14 +4354,14 @@ type SeeOthersRedirection struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -4378,16 +4378,16 @@ func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SeeOthersRedirection struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SeeOthersRedirection -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SeeOthersRedirection +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SeeOthersRedirection) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4818,14 +4818,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4851,16 +4851,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -5129,14 +5129,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5174,16 +5174,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -5396,14 +5396,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5451,16 +5451,16 @@ func _OptionalParamsStruct_Read(w wire.Value) (*OptionalParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5842,14 +5842,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5881,16 +5881,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -6174,14 +6174,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -6464,16 +6464,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8511,14 +8511,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8550,16 +8550,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8767,14 +8767,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -8824,16 +8824,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9271,14 +9271,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9310,16 +9310,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9525,14 +9525,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9581,16 +9581,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9928,14 +9928,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9967,16 +9967,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -10182,14 +10182,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10229,16 +10229,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -10562,14 +10562,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10601,16 +10601,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -10816,14 +10816,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10865,16 +10865,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -11204,14 +11204,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11243,16 +11243,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -11457,14 +11457,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11492,16 +11492,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -11769,14 +11769,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11808,16 +11808,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -12051,14 +12051,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -12125,16 +12125,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12643,14 +12643,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12682,16 +12682,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12896,14 +12896,14 @@ type Bar_DeleteFoo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12929,16 +12929,16 @@ func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Args) FromWire(w wire.Value) error { var err error @@ -13192,14 +13192,14 @@ type Bar_DeleteFoo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13216,16 +13216,16 @@ func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13354,14 +13354,14 @@ type Bar_DeleteWithBody_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13395,16 +13395,16 @@ func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Args) FromWire(w wire.Value) error { var err error @@ -13716,14 +13716,14 @@ type Bar_DeleteWithBody_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13740,16 +13740,16 @@ func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13878,14 +13878,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13919,16 +13919,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -14240,14 +14240,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14264,16 +14264,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14400,14 +14400,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14424,16 +14424,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14666,14 +14666,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14727,16 +14727,16 @@ func _SeeOthersRedirection_Read(w wire.Value) (*SeeOthersRedirection, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -15073,14 +15073,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -15122,16 +15122,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -15537,14 +15537,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15584,16 +15584,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -15861,14 +15861,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15885,16 +15885,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -16115,14 +16115,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16162,16 +16162,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -16435,14 +16435,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -16459,16 +16459,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -16689,14 +16689,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16736,16 +16736,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -17010,14 +17010,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17046,16 +17046,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -17342,14 +17342,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17389,16 +17389,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -17663,14 +17663,14 @@ type Bar_NormalRecur_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17699,16 +17699,16 @@ func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Args) FromWire(w wire.Value) error { var err error @@ -17995,14 +17995,14 @@ type Bar_NormalRecur_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18048,16 +18048,16 @@ func _BarResponseRecur_Read(w wire.Value) (*BarResponseRecur, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Result) FromWire(w wire.Value) error { var err error @@ -18329,14 +18329,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18379,16 +18379,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -18747,14 +18747,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -18808,16 +18808,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error @@ -19148,14 +19148,14 @@ type Echo_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19184,16 +19184,16 @@ func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -19465,14 +19465,14 @@ type Echo_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19504,16 +19504,16 @@ func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -19718,14 +19718,14 @@ type Echo_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19751,16 +19751,16 @@ func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -20024,14 +20024,14 @@ type Echo_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20063,16 +20063,16 @@ func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -20281,14 +20281,14 @@ type Echo_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20314,16 +20314,16 @@ func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -20587,14 +20587,14 @@ type Echo_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20626,16 +20626,16 @@ func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -20856,14 +20856,14 @@ func Default_Echo_EchoEnum_Args() *Echo_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20895,16 +20895,16 @@ func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -21184,14 +21184,14 @@ type Echo_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21223,16 +21223,16 @@ func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -21441,14 +21441,14 @@ type Echo_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21474,16 +21474,16 @@ func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -21747,14 +21747,14 @@ type Echo_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21786,16 +21786,16 @@ func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -22004,14 +22004,14 @@ type Echo_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22037,16 +22037,16 @@ func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -22310,14 +22310,14 @@ type Echo_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22349,16 +22349,16 @@ func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -22605,14 +22605,14 @@ func (_Map_I32_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22669,16 +22669,16 @@ func _Map_I32_BarResponse_Read(m wire.MapItemList) (map[int32]*BarResponse, erro // An error is returned if we were unable to build a Echo_EchoI32Map_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Args) FromWire(w wire.Value) error { var err error @@ -23057,14 +23057,14 @@ type Echo_EchoI32Map_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23096,16 +23096,16 @@ func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32Map_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Result) FromWire(w wire.Value) error { var err error @@ -23310,14 +23310,14 @@ type Echo_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23343,16 +23343,16 @@ func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -23616,14 +23616,14 @@ type Echo_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23655,16 +23655,16 @@ func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -23873,14 +23873,14 @@ type Echo_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23906,16 +23906,16 @@ func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -24179,14 +24179,14 @@ type Echo_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24218,16 +24218,16 @@ func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -24436,14 +24436,14 @@ type Echo_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24469,16 +24469,16 @@ func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -24742,14 +24742,14 @@ type Echo_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24781,16 +24781,16 @@ func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -24999,14 +24999,14 @@ type Echo_EchoStringList_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25032,16 +25032,16 @@ func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -25310,14 +25310,14 @@ type Echo_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25349,16 +25349,16 @@ func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -25601,14 +25601,14 @@ func (_Map_String_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25665,16 +25665,16 @@ func _Map_String_BarResponse_Read(m wire.MapItemList) (map[string]*BarResponse, // An error is returned if we were unable to build a Echo_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -26040,14 +26040,14 @@ type Echo_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26079,16 +26079,16 @@ func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -26319,14 +26319,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26374,16 +26374,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -26731,14 +26731,14 @@ type Echo_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26770,16 +26770,16 @@ func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -27013,14 +27013,14 @@ func (_List_BarResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27064,16 +27064,16 @@ func _List_BarResponse_Read(l wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -27419,14 +27419,14 @@ type Echo_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27458,16 +27458,16 @@ func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -27718,14 +27718,14 @@ func (_Map_BarResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27791,16 +27791,16 @@ func _Map_BarResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a Echo_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -28237,14 +28237,14 @@ type Echo_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28276,16 +28276,16 @@ func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -28522,14 +28522,14 @@ func (_Set_BarResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28577,16 +28577,16 @@ func _Set_BarResponse_sliceType_Read(s wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -28944,14 +28944,14 @@ type Echo_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28983,16 +28983,16 @@ func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -29197,14 +29197,14 @@ type Echo_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -29230,16 +29230,16 @@ func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -29503,14 +29503,14 @@ type Echo_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -29542,16 +29542,16 @@ func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go index b1bf4460d..595c9d0ab 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go @@ -25,14 +25,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -230,14 +230,14 @@ type NestHeaders struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestHeaders) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -271,16 +271,16 @@ func (v *NestHeaders) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestHeaders struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestHeaders -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestHeaders +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestHeaders) FromWire(w wire.Value) error { var err error @@ -508,14 +508,14 @@ type NestedStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestedStruct) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -549,16 +549,16 @@ func (v *NestedStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestedStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestedStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestedStruct) FromWire(w wire.Value) error { var err error @@ -785,14 +785,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -818,16 +818,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -1000,14 +1000,14 @@ type TransHeaders struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeaders) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1050,16 +1050,16 @@ func _Wrapped_Read(w wire.Value) (*Wrapped, error) { // An error is returned if we were unable to build a TransHeaders struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeaders -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeaders +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeaders) FromWire(w wire.Value) error { var err error @@ -1288,14 +1288,14 @@ type TransStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransStruct) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1344,16 +1344,16 @@ func _NestedStruct_Read(w wire.Value) (*NestedStruct, error) { // An error is returned if we were unable to build a TransStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransStruct) FromWire(w wire.Value) error { var err error @@ -1680,14 +1680,14 @@ type Wrapped struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Wrapped) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1730,16 +1730,16 @@ func _NestHeaders_Read(w wire.Value) (*NestHeaders, error) { // An error is returned if we were unable to build a Wrapped struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Wrapped -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Wrapped +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Wrapped) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go index a8c591721..60df83835 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go @@ -31,14 +31,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -247,14 +247,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -294,16 +294,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -570,8 +570,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -628,10 +628,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -648,16 +648,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -665,13 +665,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -762,14 +762,14 @@ type GetProfileRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileRequest) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -801,16 +801,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a GetProfileRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileRequest) FromWire(w wire.Value) error { var err error @@ -1007,14 +1007,14 @@ func (_List_Profile_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1064,16 +1064,16 @@ func _List_Profile_Read(l wire.ValueList) ([]*Profile, error) { // An error is returned if we were unable to build a GetProfileResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileResponse) FromWire(w wire.Value) error { var err error @@ -1322,14 +1322,14 @@ type HeaderSchema struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *HeaderSchema) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1346,16 +1346,16 @@ func (v *HeaderSchema) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a HeaderSchema struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v HeaderSchema -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v HeaderSchema +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *HeaderSchema) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1465,14 +1465,14 @@ type OtherAuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OtherAuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1498,16 +1498,16 @@ func (v *OtherAuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OtherAuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OtherAuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OtherAuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OtherAuthErr) FromWire(w wire.Value) error { var err error @@ -1679,14 +1679,14 @@ type Profile struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Profile) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1721,16 +1721,16 @@ func _Recur1_Read(w wire.Value) (*Recur1, error) { // An error is returned if we were unable to build a Profile struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Profile -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Profile +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Profile) FromWire(w wire.Value) error { var err error @@ -1944,14 +1944,14 @@ func (_Map_UUID_Recur2_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2014,16 +2014,16 @@ func _Map_UUID_Recur2_Read(m wire.MapItemList) (map[UUID]*Recur2, error) { // An error is returned if we were unable to build a Recur1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur1) FromWire(w wire.Value) error { var err error @@ -2294,14 +2294,14 @@ type Recur2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur2) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2344,16 +2344,16 @@ func _Recur3_Read(w wire.Value) (*Recur3, error) { // An error is returned if we were unable to build a Recur2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur2) FromWire(w wire.Value) error { var err error @@ -2580,14 +2580,14 @@ type Recur3 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur3) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2613,16 +2613,16 @@ func (v *Recur3) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Recur3 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur3 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur3 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur3) FromWire(w wire.Value) error { var err error @@ -2838,14 +2838,14 @@ type TransHeaderType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeaderType) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -2916,16 +2916,16 @@ func (v *TransHeaderType) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TransHeaderType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeaderType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeaderType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeaderType) FromWire(w wire.Value) error { var err error @@ -3438,14 +3438,14 @@ type SecondService_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3474,16 +3474,16 @@ func (v *SecondService_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -3755,14 +3755,14 @@ type SecondService_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3794,16 +3794,16 @@ func (v *SecondService_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -4008,14 +4008,14 @@ type SecondService_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4041,16 +4041,16 @@ func (v *SecondService_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -4314,14 +4314,14 @@ type SecondService_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4353,16 +4353,16 @@ func (v *SecondService_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -4581,14 +4581,14 @@ type SecondService_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4614,16 +4614,16 @@ func (v *SecondService_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -4887,14 +4887,14 @@ type SecondService_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4926,16 +4926,16 @@ func (v *SecondService_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -5156,14 +5156,14 @@ func Default_SecondService_EchoEnum_Args() *SecondService_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5201,16 +5201,16 @@ func _Fruit_Read(w wire.Value) (Fruit, error) { // An error is returned if we were unable to build a SecondService_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -5506,14 +5506,14 @@ type SecondService_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5545,16 +5545,16 @@ func (v *SecondService_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -5763,14 +5763,14 @@ type SecondService_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5796,16 +5796,16 @@ func (v *SecondService_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -6069,14 +6069,14 @@ type SecondService_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6108,16 +6108,16 @@ func (v *SecondService_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -6336,14 +6336,14 @@ type SecondService_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6369,16 +6369,16 @@ func (v *SecondService_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -6642,14 +6642,14 @@ type SecondService_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6681,16 +6681,16 @@ func (v *SecondService_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -6899,14 +6899,14 @@ type SecondService_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6932,16 +6932,16 @@ func (v *SecondService_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -7205,14 +7205,14 @@ type SecondService_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7244,16 +7244,16 @@ func (v *SecondService_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -7472,14 +7472,14 @@ type SecondService_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7505,16 +7505,16 @@ func (v *SecondService_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -7778,14 +7778,14 @@ type SecondService_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7817,16 +7817,16 @@ func (v *SecondService_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -8045,14 +8045,14 @@ type SecondService_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8078,16 +8078,16 @@ func (v *SecondService_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -8351,14 +8351,14 @@ type SecondService_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8390,16 +8390,16 @@ func (v *SecondService_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -8644,14 +8644,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8695,16 +8695,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a SecondService_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -9047,14 +9047,14 @@ type SecondService_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9086,16 +9086,16 @@ func (v *SecondService_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -9338,14 +9338,14 @@ func (_Map_String_BazResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9408,16 +9408,16 @@ func _Map_String_BazResponse_Read(m wire.MapItemList) (map[string]*base.BazRespo // An error is returned if we were unable to build a SecondService_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -9789,14 +9789,14 @@ type SecondService_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9828,16 +9828,16 @@ func (v *SecondService_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -10068,14 +10068,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10123,16 +10123,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a SecondService_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -10480,14 +10480,14 @@ type SecondService_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10519,16 +10519,16 @@ func (v *SecondService_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -10762,14 +10762,14 @@ func (_List_BazResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10813,16 +10813,16 @@ func _List_BazResponse_Read(l wire.ValueList) ([]*base.BazResponse, error) { // An error is returned if we were unable to build a SecondService_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -11168,14 +11168,14 @@ type SecondService_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11207,16 +11207,16 @@ func (v *SecondService_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -11467,14 +11467,14 @@ func (_Map_BazResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11540,16 +11540,16 @@ func _Map_BazResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a SecondService_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -11986,14 +11986,14 @@ type SecondService_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12025,16 +12025,16 @@ func (v *SecondService_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -12271,14 +12271,14 @@ func (_Set_BazResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12326,16 +12326,16 @@ func _Set_BazResponse_sliceType_Read(s wire.ValueList) ([]*base.BazResponse, err // An error is returned if we were unable to build a SecondService_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -12693,14 +12693,14 @@ type SecondService_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12732,16 +12732,16 @@ func (v *SecondService_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -12946,14 +12946,14 @@ type SecondService_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12985,16 +12985,16 @@ func _UUID_1_Read(w wire.Value) (base.UUID, error) { // An error is returned if we were unable to build a SecondService_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -13264,14 +13264,14 @@ type SecondService_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -13303,16 +13303,16 @@ func (v *SecondService_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoTypedef_Result) FromWire(w wire.Value) error { var err error @@ -13533,14 +13533,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13591,16 +13591,16 @@ func _BazRequest_Read(w wire.Value) (*BazRequest, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -13999,14 +13999,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -14044,16 +14044,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -14266,14 +14266,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14318,16 +14318,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -14720,14 +14720,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -14759,16 +14759,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -14974,14 +14974,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15019,16 +15019,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -15387,14 +15387,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -15448,16 +15448,16 @@ func _OtherAuthErr_Read(w wire.Value) (*OtherAuthErr, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -15788,14 +15788,14 @@ type SimpleService_GetProfile_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -15830,16 +15830,16 @@ func _GetProfileRequest_Read(w wire.Value) (*GetProfileRequest, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Args) FromWire(w wire.Value) error { var err error @@ -16132,14 +16132,14 @@ type SimpleService_GetProfile_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16185,16 +16185,16 @@ func _GetProfileResponse_Read(w wire.Value) (*GetProfileResponse, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Result) FromWire(w wire.Value) error { var err error @@ -16465,14 +16465,14 @@ type SimpleService_HeaderSchema_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16507,16 +16507,16 @@ func _HeaderSchema_Read(w wire.Value) (*HeaderSchema, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Args) FromWire(w wire.Value) error { var err error @@ -16821,14 +16821,14 @@ type SimpleService_HeaderSchema_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -16876,16 +16876,16 @@ func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Result) FromWire(w wire.Value) error { var err error @@ -17209,14 +17209,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -17233,16 +17233,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -17448,14 +17448,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17487,16 +17487,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -17700,14 +17700,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -17724,16 +17724,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -17956,14 +17956,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18009,16 +18009,16 @@ func _ServerErr_Read(w wire.Value) (*base.ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error @@ -18288,14 +18288,14 @@ type SimpleService_TestUuid_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -18312,16 +18312,16 @@ func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -18517,14 +18517,14 @@ type SimpleService_TestUuid_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -18541,16 +18541,16 @@ func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -18679,14 +18679,14 @@ type SimpleService_Trans_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18729,16 +18729,16 @@ func _TransStruct_Read(w wire.Value) (*base.TransStruct, error) { // An error is returned if we were unable to build a SimpleService_Trans_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Args) FromWire(w wire.Value) error { var err error @@ -19097,14 +19097,14 @@ type SimpleService_Trans_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -19152,16 +19152,16 @@ func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Trans_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Result) FromWire(w wire.Value) error { var err error @@ -19486,14 +19486,14 @@ type SimpleService_TransHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19528,16 +19528,16 @@ func _TransHeaders_Read(w wire.Value) (*base.TransHeaders, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Args) FromWire(w wire.Value) error { var err error @@ -19842,14 +19842,14 @@ type SimpleService_TransHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -19897,16 +19897,16 @@ func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Result) FromWire(w wire.Value) error { var err error @@ -20234,14 +20234,14 @@ type SimpleService_TransHeadersNoReq_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -20299,16 +20299,16 @@ func _NestedStruct_Read(w wire.Value) (*base.NestedStruct, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Args) FromWire(w wire.Value) error { var err error @@ -20771,14 +20771,14 @@ type SimpleService_TransHeadersNoReq_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -20818,16 +20818,16 @@ func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Result) FromWire(w wire.Value) error { var err error @@ -21092,14 +21092,14 @@ type SimpleService_TransHeadersType_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21134,16 +21134,16 @@ func _TransHeaderType_Read(w wire.Value) (*TransHeaderType, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Args) FromWire(w wire.Value) error { var err error @@ -21448,14 +21448,14 @@ type SimpleService_TransHeadersType_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -21503,16 +21503,16 @@ func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Result) FromWire(w wire.Value) error { var err error @@ -21836,14 +21836,14 @@ type SimpleService_UrlTest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -21860,16 +21860,16 @@ func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -22065,14 +22065,14 @@ type SimpleService_UrlTest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -22089,16 +22089,16 @@ func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go b/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go index 3671161ef..41984a4b8 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go @@ -24,14 +24,14 @@ type BadRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BadRequest) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *BadRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BadRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BadRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BadRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BadRequest) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -207,14 +207,14 @@ func (_List_ContactFragment_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contact) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -280,16 +280,16 @@ func _ContactAttributes_Read(w wire.Value) (*ContactAttributes, error) { // An error is returned if we were unable to build a Contact struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contact -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contact +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contact) FromWire(w wire.Value) error { var err error @@ -603,14 +603,14 @@ type ContactAttributes struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactAttributes) ToWire() (wire.Value, error) { var ( fields [13]wire.Field @@ -734,16 +734,16 @@ func (v *ContactAttributes) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ContactAttributes struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactAttributes -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactAttributes) FromWire(w wire.Value) error { var err error @@ -1600,14 +1600,14 @@ type ContactFragment struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactFragment) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1649,16 +1649,16 @@ func _ContactFragmentType_Read(w wire.Value) (ContactFragmentType, error) { // An error is returned if we were unable to build a ContactFragment struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactFragment -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactFragment +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactFragment) FromWire(w wire.Value) error { var err error @@ -1942,14 +1942,14 @@ type NotFound struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotFound) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1966,16 +1966,16 @@ func (v *NotFound) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotFound struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotFound -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotFound +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotFound) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2125,14 +2125,14 @@ func (_List_Contact_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsRequest) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2189,16 +2189,16 @@ func _List_Contact_Read(l wire.ValueList) ([]*Contact, error) { // An error is returned if we were unable to build a SaveContactsRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsRequest) FromWire(w wire.Value) error { var err error @@ -2496,14 +2496,14 @@ type SaveContactsResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsResponse) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2520,16 +2520,16 @@ func (v *SaveContactsResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SaveContactsResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsResponse) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2690,14 +2690,14 @@ type Contacts_SaveContacts_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2732,16 +2732,16 @@ func _SaveContactsRequest_Read(w wire.Value) (*SaveContactsRequest, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Args) FromWire(w wire.Value) error { var err error @@ -3046,14 +3046,14 @@ type Contacts_SaveContacts_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3119,16 +3119,16 @@ func _NotFound_Read(w wire.Value) (*NotFound, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Result) FromWire(w wire.Value) error { var err error @@ -3470,14 +3470,14 @@ type Contacts_TestUrlUrl_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3494,16 +3494,16 @@ func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3709,14 +3709,14 @@ type Contacts_TestUrlUrl_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3748,16 +3748,16 @@ func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go b/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go index 11f173d5d..5f1599bcf 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go @@ -24,14 +24,14 @@ type Foo struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Foo) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *Foo) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Foo struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Foo -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Foo +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Foo) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -166,14 +166,14 @@ type NotModified struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotModified) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -190,16 +190,16 @@ func (v *NotModified) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotModified struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotModified -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotModified +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotModified) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -322,14 +322,14 @@ type Corge_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -355,16 +355,16 @@ func (v *Corge_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -628,14 +628,14 @@ type Corge_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -667,16 +667,16 @@ func (v *Corge_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -895,14 +895,14 @@ type Corge_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -928,16 +928,16 @@ func (v *Corge_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -1201,14 +1201,14 @@ type Corge_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1240,16 +1240,16 @@ func (v *Corge_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -1468,14 +1468,14 @@ type Corge_NoContent_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContent_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1501,16 +1501,16 @@ func (v *Corge_NoContent_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContent_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContent_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContent_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContent_Args) FromWire(w wire.Value) error { var err error @@ -1779,14 +1779,14 @@ type Corge_NoContent_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContent_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1824,16 +1824,16 @@ func _NotModified_Read(w wire.Value) (*NotModified, error) { // An error is returned if we were unable to build a Corge_NoContent_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContent_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContent_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContent_Result) FromWire(w wire.Value) error { var err error @@ -2044,14 +2044,14 @@ type Corge_NoContentNoException_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentNoException_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2077,16 +2077,16 @@ func (v *Corge_NoContentNoException_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentNoException_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentNoException_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentNoException_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentNoException_Args) FromWire(w wire.Value) error { var err error @@ -2340,14 +2340,14 @@ type Corge_NoContentNoException_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentNoException_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2364,16 +2364,16 @@ func (v *Corge_NoContentNoException_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentNoException_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentNoException_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentNoException_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentNoException_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2501,14 +2501,14 @@ type Corge_NoContentOnException_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentOnException_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2534,16 +2534,16 @@ func (v *Corge_NoContentOnException_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentOnException_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentOnException_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentOnException_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentOnException_Args) FromWire(w wire.Value) error { var err error @@ -2822,14 +2822,14 @@ type Corge_NoContentOnException_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentOnException_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2875,16 +2875,16 @@ func _Foo_Read(w wire.Value) (*Foo, error) { // An error is returned if we were unable to build a Corge_NoContentOnException_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentOnException_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentOnException_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentOnException_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go b/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go index ac9418fe6..5fcf5f61d 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go @@ -107,10 +107,10 @@ type FxEchoYARPCClientResult struct { // NewFxEchoYARPCClient provides a EchoYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCClient("service-name"), +// ... +// ) func NewFxEchoYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoYARPCClientParams) FxEchoYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxEchoYARPCProceduresResult struct { // NewFxEchoYARPCProcedures provides EchoYARPCServer procedures to an Fx application. // It expects a EchoYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCProcedures(), +// ... +// ) func NewFxEchoYARPCProcedures() interface{} { return func(params FxEchoYARPCProceduresParams) FxEchoYARPCProceduresResult { return FxEchoYARPCProceduresResult{ diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go index b53de2e66..6a6319ad1 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go index 952c40476..1dc2efe9d 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go b/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go index 90f9d62d5..b5d3d057a 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go @@ -27,14 +27,14 @@ type GoogleNowService_AddCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_AddCredentials_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *GoogleNowService_AddCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_AddCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_AddCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_AddCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_AddCredentials_Args) FromWire(w wire.Value) error { var err error @@ -323,14 +323,14 @@ type GoogleNowService_AddCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_AddCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -347,16 +347,16 @@ func (v *GoogleNowService_AddCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_AddCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_AddCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_AddCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_AddCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -483,14 +483,14 @@ type GoogleNowService_CheckCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_CheckCredentials_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -507,16 +507,16 @@ func (v *GoogleNowService_CheckCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_CheckCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_CheckCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_CheckCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_CheckCredentials_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -712,14 +712,14 @@ type GoogleNowService_CheckCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_CheckCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -736,16 +736,16 @@ func (v *GoogleNowService_CheckCredentials_Result) ToWire() (wire.Value, error) // An error is returned if we were unable to build a GoogleNowService_CheckCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_CheckCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_CheckCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_CheckCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go b/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go index 3cc22c40a..669caf5c0 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go @@ -26,14 +26,14 @@ type ServiceABack_HelloA_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceABack_HelloA_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *ServiceABack_HelloA_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceABack_HelloA_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceABack_HelloA_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceABack_HelloA_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceABack_HelloA_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type ServiceABack_HelloA_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceABack_HelloA_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *ServiceABack_HelloA_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceABack_HelloA_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceABack_HelloA_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceABack_HelloA_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceABack_HelloA_Result) FromWire(w wire.Value) error { var err error @@ -531,14 +531,14 @@ type ServiceBBack_HelloB_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBBack_HelloB_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -555,16 +555,16 @@ func (v *ServiceBBack_HelloB_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBBack_HelloB_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBBack_HelloB_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBBack_HelloB_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBBack_HelloB_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -770,14 +770,14 @@ type ServiceBBack_HelloB_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBBack_HelloB_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -809,16 +809,16 @@ func (v *ServiceBBack_HelloB_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBBack_HelloB_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBBack_HelloB_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBBack_HelloB_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBBack_HelloB_Result) FromWire(w wire.Value) error { var err error @@ -1026,14 +1026,14 @@ type ServiceCBack_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCBack_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1050,16 +1050,16 @@ func (v *ServiceCBack_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCBack_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCBack_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCBack_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCBack_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1265,14 +1265,14 @@ type ServiceCBack_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCBack_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1304,16 +1304,16 @@ func (v *ServiceCBack_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCBack_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCBack_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCBack_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCBack_Hello_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go b/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go index 9bf9bc20f..c93f1aa61 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go @@ -25,14 +25,14 @@ type ExceptionType1 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ExceptionType1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *ExceptionType1) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ExceptionType1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ExceptionType1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ExceptionType1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ExceptionType1) FromWire(w wire.Value) error { var err error @@ -239,14 +239,14 @@ type ExceptionType2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ExceptionType2) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -272,16 +272,16 @@ func (v *ExceptionType2) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ExceptionType2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ExceptionType2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ExceptionType2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ExceptionType2) FromWire(w wire.Value) error { var err error @@ -452,14 +452,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -476,16 +476,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -597,14 +597,14 @@ type WithExceptions_Func1_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -621,16 +621,16 @@ func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -863,14 +863,14 @@ type WithExceptions_Func1_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -936,16 +936,16 @@ func _ExceptionType2_Read(w wire.Value) (*ExceptionType2, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go index d92699ddb..f113f39ce 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go @@ -26,14 +26,14 @@ type AppDemoService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AppDemoService_Call_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *AppDemoService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AppDemoService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AppDemoService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AppDemoService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AppDemoService_Call_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type AppDemoService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AppDemoService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *AppDemoService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AppDemoService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AppDemoService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AppDemoService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AppDemoService_Call_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go index 32e9119c1..b1186bbfd 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -856,14 +856,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1006,16 +1006,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1698,8 +1698,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -1756,10 +1756,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -1776,16 +1776,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -1793,13 +1793,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -1897,8 +1897,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -1955,10 +1955,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -1975,16 +1975,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -1992,13 +1992,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2137,14 +2137,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2170,16 +2170,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -2344,14 +2344,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -2401,16 +2401,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -2777,14 +2777,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -2859,16 +2859,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -3326,14 +3326,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -3375,16 +3375,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -3602,14 +3602,14 @@ type SeeOthersRedirection struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3626,16 +3626,16 @@ func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SeeOthersRedirection struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SeeOthersRedirection -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SeeOthersRedirection +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SeeOthersRedirection) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4066,14 +4066,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4099,16 +4099,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -4377,14 +4377,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4422,16 +4422,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -4643,14 +4643,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4684,16 +4684,16 @@ func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5015,14 +5015,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5054,16 +5054,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -5347,14 +5347,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -5637,16 +5637,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -7684,14 +7684,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7723,16 +7723,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -7940,14 +7940,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -7997,16 +7997,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8444,14 +8444,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8483,16 +8483,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8698,14 +8698,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -8754,16 +8754,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9101,14 +9101,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9140,16 +9140,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9355,14 +9355,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9402,16 +9402,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -9735,14 +9735,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9774,16 +9774,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -9989,14 +9989,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10038,16 +10038,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -10377,14 +10377,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10416,16 +10416,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -10630,14 +10630,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10665,16 +10665,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -10942,14 +10942,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10981,16 +10981,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -11224,14 +11224,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -11298,16 +11298,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -11816,14 +11816,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11855,16 +11855,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12070,14 +12070,14 @@ type Bar_DeleteWithBody_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -12111,16 +12111,16 @@ func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Args) FromWire(w wire.Value) error { var err error @@ -12432,14 +12432,14 @@ type Bar_DeleteWithBody_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12456,16 +12456,16 @@ func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -12594,14 +12594,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -12635,16 +12635,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12956,14 +12956,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12980,16 +12980,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13116,14 +13116,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13140,16 +13140,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13382,14 +13382,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13443,16 +13443,16 @@ func _SeeOthersRedirection_Read(w wire.Value) (*SeeOthersRedirection, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -13789,14 +13789,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13838,16 +13838,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -14253,14 +14253,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14300,16 +14300,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -14577,14 +14577,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14601,16 +14601,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14831,14 +14831,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14878,16 +14878,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -15151,14 +15151,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15175,16 +15175,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15405,14 +15405,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15452,16 +15452,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -15726,14 +15726,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -15762,16 +15762,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -16058,14 +16058,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16105,16 +16105,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -16380,14 +16380,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16430,16 +16430,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -16798,14 +16798,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -16859,16 +16859,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go index 7f8322101..936aeb2b6 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go @@ -25,14 +25,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -241,14 +241,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -288,16 +288,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -557,14 +557,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -590,16 +590,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -761,14 +761,14 @@ type GetProfileRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileRequest) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -800,16 +800,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a GetProfileRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileRequest) FromWire(w wire.Value) error { var err error @@ -1006,14 +1006,14 @@ func (_List_Profile_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1063,16 +1063,16 @@ func _List_Profile_Read(l wire.ValueList) ([]*Profile, error) { // An error is returned if we were unable to build a GetProfileResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileResponse) FromWire(w wire.Value) error { var err error @@ -1321,14 +1321,14 @@ type HeaderSchema struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *HeaderSchema) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1345,16 +1345,16 @@ func (v *HeaderSchema) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a HeaderSchema struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v HeaderSchema -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v HeaderSchema +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *HeaderSchema) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1465,14 +1465,14 @@ type NestedStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestedStruct) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1506,16 +1506,16 @@ func (v *NestedStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestedStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestedStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestedStruct) FromWire(w wire.Value) error { var err error @@ -1742,14 +1742,14 @@ type OtherAuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OtherAuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1775,16 +1775,16 @@ func (v *OtherAuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OtherAuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OtherAuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OtherAuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OtherAuthErr) FromWire(w wire.Value) error { var err error @@ -1956,14 +1956,14 @@ type Profile struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Profile) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1998,16 +1998,16 @@ func _Recur1_Read(w wire.Value) (*Recur1, error) { // An error is returned if we were unable to build a Profile struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Profile -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Profile +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Profile) FromWire(w wire.Value) error { var err error @@ -2221,14 +2221,14 @@ func (_Map_UUID_Recur2_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2291,16 +2291,16 @@ func _Map_UUID_Recur2_Read(m wire.MapItemList) (map[UUID]*Recur2, error) { // An error is returned if we were unable to build a Recur1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur1) FromWire(w wire.Value) error { var err error @@ -2571,14 +2571,14 @@ type Recur2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur2) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2622,16 +2622,16 @@ func _Recur3_Read(w wire.Value) (*Recur3, error) { // An error is returned if we were unable to build a Recur2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur2) FromWire(w wire.Value) error { var err error @@ -2864,14 +2864,14 @@ type Recur3 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur3) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2897,16 +2897,16 @@ func (v *Recur3) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Recur3 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur3 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur3 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur3) FromWire(w wire.Value) error { var err error @@ -3068,14 +3068,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3101,16 +3101,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -3281,14 +3281,14 @@ type TransHeader struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeader) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3305,16 +3305,16 @@ func (v *TransHeader) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TransHeader struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeader -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeader +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeader) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3426,14 +3426,14 @@ type TransStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransStruct) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3482,16 +3482,16 @@ func _NestedStruct_Read(w wire.Value) (*NestedStruct, error) { // An error is returned if we were unable to build a TransStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransStruct) FromWire(w wire.Value) error { var err error @@ -3822,14 +3822,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3880,16 +3880,16 @@ func _BazRequest_Read(w wire.Value) (*BazRequest, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -4308,14 +4308,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4353,16 +4353,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -4575,14 +4575,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -4627,16 +4627,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -5029,14 +5029,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5068,16 +5068,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -5283,14 +5283,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -5328,16 +5328,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -5696,14 +5696,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5763,16 +5763,16 @@ func _OtherAuthErr_Read(w wire.Value) (*OtherAuthErr, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -6109,14 +6109,14 @@ type SimpleService_GetProfile_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6151,16 +6151,16 @@ func _GetProfileRequest_Read(w wire.Value) (*GetProfileRequest, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Args) FromWire(w wire.Value) error { var err error @@ -6453,14 +6453,14 @@ type SimpleService_GetProfile_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -6506,16 +6506,16 @@ func _GetProfileResponse_Read(w wire.Value) (*GetProfileResponse, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Result) FromWire(w wire.Value) error { var err error @@ -6786,14 +6786,14 @@ type SimpleService_HeaderSchema_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6828,16 +6828,16 @@ func _HeaderSchema_Read(w wire.Value) (*HeaderSchema, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Args) FromWire(w wire.Value) error { var err error @@ -7142,14 +7142,14 @@ type SimpleService_HeaderSchema_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -7197,16 +7197,16 @@ func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Result) FromWire(w wire.Value) error { var err error @@ -7530,14 +7530,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -7554,16 +7554,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -7769,14 +7769,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7808,16 +7808,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -8021,14 +8021,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8045,16 +8045,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -8277,14 +8277,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -8330,16 +8330,16 @@ func _ServerErr_Read(w wire.Value) (*ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error @@ -8609,14 +8609,14 @@ type SimpleService_TestUuid_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8633,16 +8633,16 @@ func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -8838,14 +8838,14 @@ type SimpleService_TestUuid_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8862,16 +8862,16 @@ func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -9000,14 +9000,14 @@ type SimpleService_Trans_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9050,16 +9050,16 @@ func _TransStruct_Read(w wire.Value) (*TransStruct, error) { // An error is returned if we were unable to build a SimpleService_Trans_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Args) FromWire(w wire.Value) error { var err error @@ -9418,14 +9418,14 @@ type SimpleService_Trans_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -9473,16 +9473,16 @@ func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Trans_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Result) FromWire(w wire.Value) error { var err error @@ -9807,14 +9807,14 @@ type SimpleService_TransHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9849,16 +9849,16 @@ func _TransHeader_Read(w wire.Value) (*TransHeader, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Args) FromWire(w wire.Value) error { var err error @@ -10163,14 +10163,14 @@ type SimpleService_TransHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -10218,16 +10218,16 @@ func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Result) FromWire(w wire.Value) error { var err error @@ -10551,14 +10551,14 @@ type SimpleService_TransHeadersNoReq_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -10575,16 +10575,16 @@ func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -10805,14 +10805,14 @@ type SimpleService_TransHeadersNoReq_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10852,16 +10852,16 @@ func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Result) FromWire(w wire.Value) error { var err error @@ -11126,14 +11126,14 @@ type SimpleService_TransHeadersType_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11162,16 +11162,16 @@ func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Args) FromWire(w wire.Value) error { var err error @@ -11470,14 +11470,14 @@ type SimpleService_TransHeadersType_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -11525,16 +11525,16 @@ func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Result) FromWire(w wire.Value) error { var err error @@ -11858,14 +11858,14 @@ type SimpleService_UrlTest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -11882,16 +11882,16 @@ func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -12087,14 +12087,14 @@ type SimpleService_UrlTest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12111,16 +12111,16 @@ func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go index 109ea1040..2196bf6a4 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go @@ -27,14 +27,14 @@ type Bounce_Bounce_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Bounce_Bounce_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go index b63d2761f..78d51e070 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go @@ -26,14 +26,14 @@ type Request struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Request) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -69,16 +69,16 @@ func (v *Request) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Request struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Request -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Request +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Request) FromWire(w wire.Value) error { var err error @@ -310,14 +310,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -353,16 +353,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { var err error @@ -587,14 +587,14 @@ type Clientless_Beta_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_Beta_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -636,16 +636,16 @@ func _Request_Read(w wire.Value) (*Request, error) { // An error is returned if we were unable to build a Clientless_Beta_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_Beta_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_Beta_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_Beta_Args) FromWire(w wire.Value) error { var err error @@ -973,14 +973,14 @@ type Clientless_Beta_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_Beta_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1018,16 +1018,16 @@ func _Response_Read(w wire.Value) (*Response, error) { // An error is returned if we were unable to build a Clientless_Beta_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_Beta_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_Beta_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_Beta_Result) FromWire(w wire.Value) error { var err error @@ -1239,14 +1239,14 @@ type Clientless_ClientlessArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_ClientlessArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1280,16 +1280,16 @@ func (v *Clientless_ClientlessArgWithHeaders_Args) ToWire() (wire.Value, error) // An error is returned if we were unable to build a Clientless_ClientlessArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_ClientlessArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_ClientlessArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_ClientlessArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -1611,14 +1611,14 @@ type Clientless_ClientlessArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_ClientlessArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1650,16 +1650,16 @@ func (v *Clientless_ClientlessArgWithHeaders_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Clientless_ClientlessArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_ClientlessArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_ClientlessArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_ClientlessArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -1864,14 +1864,14 @@ type Clientless_EmptyclientlessRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_EmptyclientlessRequest_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1899,16 +1899,16 @@ func (v *Clientless_EmptyclientlessRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Clientless_EmptyclientlessRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_EmptyclientlessRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_EmptyclientlessRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_EmptyclientlessRequest_Args) FromWire(w wire.Value) error { var err error @@ -2166,14 +2166,14 @@ type Clientless_EmptyclientlessRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_EmptyclientlessRequest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2190,16 +2190,16 @@ func (v *Clientless_EmptyclientlessRequest_Result) ToWire() (wire.Value, error) // An error is returned if we were unable to build a Clientless_EmptyclientlessRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_EmptyclientlessRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_EmptyclientlessRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_EmptyclientlessRequest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go index 3671161ef..41984a4b8 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go @@ -24,14 +24,14 @@ type BadRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BadRequest) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *BadRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BadRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BadRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BadRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BadRequest) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -207,14 +207,14 @@ func (_List_ContactFragment_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contact) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -280,16 +280,16 @@ func _ContactAttributes_Read(w wire.Value) (*ContactAttributes, error) { // An error is returned if we were unable to build a Contact struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contact -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contact +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contact) FromWire(w wire.Value) error { var err error @@ -603,14 +603,14 @@ type ContactAttributes struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactAttributes) ToWire() (wire.Value, error) { var ( fields [13]wire.Field @@ -734,16 +734,16 @@ func (v *ContactAttributes) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ContactAttributes struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactAttributes -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactAttributes) FromWire(w wire.Value) error { var err error @@ -1600,14 +1600,14 @@ type ContactFragment struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactFragment) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1649,16 +1649,16 @@ func _ContactFragmentType_Read(w wire.Value) (ContactFragmentType, error) { // An error is returned if we were unable to build a ContactFragment struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactFragment -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactFragment +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactFragment) FromWire(w wire.Value) error { var err error @@ -1942,14 +1942,14 @@ type NotFound struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotFound) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1966,16 +1966,16 @@ func (v *NotFound) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotFound struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotFound -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotFound +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotFound) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2125,14 +2125,14 @@ func (_List_Contact_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsRequest) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2189,16 +2189,16 @@ func _List_Contact_Read(l wire.ValueList) ([]*Contact, error) { // An error is returned if we were unable to build a SaveContactsRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsRequest) FromWire(w wire.Value) error { var err error @@ -2496,14 +2496,14 @@ type SaveContactsResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsResponse) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2520,16 +2520,16 @@ func (v *SaveContactsResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SaveContactsResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsResponse) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2690,14 +2690,14 @@ type Contacts_SaveContacts_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2732,16 +2732,16 @@ func _SaveContactsRequest_Read(w wire.Value) (*SaveContactsRequest, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Args) FromWire(w wire.Value) error { var err error @@ -3046,14 +3046,14 @@ type Contacts_SaveContacts_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3119,16 +3119,16 @@ func _NotFound_Read(w wire.Value) (*NotFound, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Result) FromWire(w wire.Value) error { var err error @@ -3470,14 +3470,14 @@ type Contacts_TestUrlUrl_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3494,16 +3494,16 @@ func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3709,14 +3709,14 @@ type Contacts_TestUrlUrl_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3748,16 +3748,16 @@ func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go index b53de2e66..6a6319ad1 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go index c5c2ee49d..2fe5c0dfc 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go index 5159ffae5..83aa729bd 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go @@ -27,14 +27,14 @@ type GoogleNow_AddCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_AddCredentials_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *GoogleNow_AddCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_AddCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_AddCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_AddCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_AddCredentials_Args) FromWire(w wire.Value) error { var err error @@ -323,14 +323,14 @@ type GoogleNow_AddCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_AddCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -347,16 +347,16 @@ func (v *GoogleNow_AddCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_AddCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_AddCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_AddCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_AddCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -483,14 +483,14 @@ type GoogleNow_CheckCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_CheckCredentials_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -507,16 +507,16 @@ func (v *GoogleNow_CheckCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_CheckCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_CheckCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_CheckCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_CheckCredentials_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -712,14 +712,14 @@ type GoogleNow_CheckCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_CheckCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -736,16 +736,16 @@ func (v *GoogleNow_CheckCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_CheckCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_CheckCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_CheckCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_CheckCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go index 65ebdf150..0c5f9cfa0 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go @@ -26,14 +26,14 @@ type Dgx struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Dgx) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -74,16 +74,16 @@ func (v *Dgx) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Dgx struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Dgx -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Dgx +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Dgx) FromWire(w wire.Value) error { var err error @@ -360,14 +360,14 @@ type Fred struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Fred) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -400,16 +400,16 @@ func (v *Fred) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Fred struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Fred -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Fred +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Fred) FromWire(w wire.Value) error { var err error @@ -621,14 +621,14 @@ type Garply struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Garply) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -664,16 +664,16 @@ func (v *Garply) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Garply struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Garply -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Garply +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Garply) FromWire(w wire.Value) error { var err error @@ -905,14 +905,14 @@ type Grault struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Grault) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -948,16 +948,16 @@ func (v *Grault) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Grault struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Grault -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Grault +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Grault) FromWire(w wire.Value) error { var err error @@ -1178,14 +1178,14 @@ type Thud struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Thud) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1213,16 +1213,16 @@ func (v *Thud) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Thud struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Thud -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Thud +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Thud) FromWire(w wire.Value) error { var err error @@ -1388,14 +1388,14 @@ type TokenOnly struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TokenOnly) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1421,16 +1421,16 @@ func (v *TokenOnly) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TokenOnly struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TokenOnly -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TokenOnly +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TokenOnly) FromWire(w wire.Value) error { var err error @@ -1592,14 +1592,14 @@ type UUIDOnly struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *UUIDOnly) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1625,16 +1625,16 @@ func (v *UUIDOnly) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a UUIDOnly struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v UUIDOnly -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v UUIDOnly +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *UUIDOnly) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go index d8a9090d3..0eb0fd252 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go @@ -26,14 +26,14 @@ type ServiceAFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceAFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *ServiceAFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceAFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceAFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceAFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceAFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type ServiceAFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceAFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *ServiceAFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceAFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceAFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceAFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceAFront_Hello_Result) FromWire(w wire.Value) error { var err error @@ -531,14 +531,14 @@ type ServiceBFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -555,16 +555,16 @@ func (v *ServiceBFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -770,14 +770,14 @@ type ServiceBFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -809,16 +809,16 @@ func (v *ServiceBFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBFront_Hello_Result) FromWire(w wire.Value) error { var err error @@ -1026,14 +1026,14 @@ type ServiceCFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1050,16 +1050,16 @@ func (v *ServiceCFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1265,14 +1265,14 @@ type ServiceCFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1304,16 +1304,16 @@ func (v *ServiceCFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCFront_Hello_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go index 57d2e4fb5..9ce0e679b 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go @@ -25,14 +25,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -241,14 +241,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -288,16 +288,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -557,14 +557,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -590,16 +590,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -761,14 +761,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -794,16 +794,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -1028,14 +1028,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1092,16 +1092,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -1526,14 +1526,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1571,16 +1571,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -1793,14 +1793,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1845,16 +1845,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -2247,14 +2247,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2286,16 +2286,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -2501,14 +2501,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2546,16 +2546,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -2902,14 +2902,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2955,16 +2955,16 @@ func _BazResponse_Read(w wire.Value) (*BazResponse, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -3235,14 +3235,14 @@ type SimpleService_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3268,16 +3268,16 @@ func (v *SimpleService_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Echo_Args) FromWire(w wire.Value) error { var err error @@ -3541,14 +3541,14 @@ type SimpleService_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3580,16 +3580,16 @@ func (v *SimpleService_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Echo_Result) FromWire(w wire.Value) error { var err error @@ -3807,14 +3807,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3831,16 +3831,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4046,14 +4046,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4085,16 +4085,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -4298,14 +4298,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -4322,16 +4322,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4554,14 +4554,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4607,16 +4607,16 @@ func _ServerErr_Read(w wire.Value) (*ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go index 25f07523a..ef55415d0 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go @@ -27,14 +27,14 @@ type Echo_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Echo_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go index ebc47b003..2e2a734a4 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go @@ -27,14 +27,14 @@ type SimpleService_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *SimpleService_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type SimpleService_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *SimpleService_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_EchoString_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go index 22430fa22..e660a22bb 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go @@ -25,14 +25,14 @@ type EndpointExceptionType1 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *EndpointExceptionType1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *EndpointExceptionType1) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a EndpointExceptionType1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v EndpointExceptionType1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v EndpointExceptionType1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *EndpointExceptionType1) FromWire(w wire.Value) error { var err error @@ -239,14 +239,14 @@ type EndpointExceptionType2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *EndpointExceptionType2) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -272,16 +272,16 @@ func (v *EndpointExceptionType2) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a EndpointExceptionType2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v EndpointExceptionType2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v EndpointExceptionType2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *EndpointExceptionType2) FromWire(w wire.Value) error { var err error @@ -452,14 +452,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -476,16 +476,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -597,14 +597,14 @@ type WithExceptions_Func1_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -621,16 +621,16 @@ func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -863,14 +863,14 @@ type WithExceptions_Func1_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -936,16 +936,16 @@ func _EndpointExceptionType2_Read(w wire.Value) (*EndpointExceptionType2, error) // An error is returned if we were unable to build a WithExceptions_Func1_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go b/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go index 58e436a48..4fff33491 100644 --- a/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go +++ b/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -781,14 +781,14 @@ type BarRequestRecur struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequestRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -828,16 +828,16 @@ func _BarRequestRecur_Read(w wire.Value) (*BarRequestRecur, error) { // An error is returned if we were unable to build a BarRequestRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequestRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequestRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequestRecur) FromWire(w wire.Value) error { var err error @@ -1132,14 +1132,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1282,16 +1282,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1994,14 +1994,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponseRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2052,16 +2052,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a BarResponseRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponseRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponseRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponseRecur) FromWire(w wire.Value) error { var err error @@ -2358,8 +2358,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -2416,10 +2416,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2436,16 +2436,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -2453,13 +2453,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2557,8 +2557,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -2615,10 +2615,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2635,16 +2635,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -2652,13 +2652,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2797,14 +2797,14 @@ type OptionalParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2832,16 +2832,16 @@ func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OptionalParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OptionalParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OptionalParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OptionalParamsStruct) FromWire(w wire.Value) error { var err error @@ -3017,14 +3017,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3050,16 +3050,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -3224,14 +3224,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -3281,16 +3281,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -3621,14 +3621,14 @@ type QueryParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -3685,16 +3685,16 @@ func (v *QueryParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -4078,14 +4078,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4127,16 +4127,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -4666,14 +4666,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4699,16 +4699,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -4977,14 +4977,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5022,16 +5022,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -5244,14 +5244,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5299,16 +5299,16 @@ func _OptionalParamsStruct_Read(w wire.Value) (*OptionalParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5690,14 +5690,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5729,16 +5729,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -6022,14 +6022,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -6312,16 +6312,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8359,14 +8359,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8398,16 +8398,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8615,14 +8615,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -8672,16 +8672,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9119,14 +9119,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9158,16 +9158,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9373,14 +9373,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9429,16 +9429,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9776,14 +9776,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9815,16 +9815,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -10030,14 +10030,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10077,16 +10077,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -10410,14 +10410,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10449,16 +10449,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -10664,14 +10664,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10713,16 +10713,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -11052,14 +11052,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11091,16 +11091,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -11305,14 +11305,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11340,16 +11340,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -11617,14 +11617,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11656,16 +11656,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -11899,14 +11899,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -11973,16 +11973,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12491,14 +12491,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12530,16 +12530,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12744,14 +12744,14 @@ type Bar_DeleteFoo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12777,16 +12777,16 @@ func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Args) FromWire(w wire.Value) error { var err error @@ -13040,14 +13040,14 @@ type Bar_DeleteFoo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13064,16 +13064,16 @@ func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13202,14 +13202,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13243,16 +13243,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -13564,14 +13564,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13588,16 +13588,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13724,14 +13724,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13748,16 +13748,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13978,14 +13978,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14025,16 +14025,16 @@ func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -14305,14 +14305,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14354,16 +14354,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -14769,14 +14769,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14816,16 +14816,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -15093,14 +15093,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15117,16 +15117,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15347,14 +15347,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15394,16 +15394,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -15667,14 +15667,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15691,16 +15691,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15921,14 +15921,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15968,16 +15968,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -16242,14 +16242,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16278,16 +16278,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -16574,14 +16574,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16621,16 +16621,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -16895,14 +16895,14 @@ type Bar_NormalRecur_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16931,16 +16931,16 @@ func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Args) FromWire(w wire.Value) error { var err error @@ -17227,14 +17227,14 @@ type Bar_NormalRecur_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17280,16 +17280,16 @@ func _BarResponseRecur_Read(w wire.Value) (*BarResponseRecur, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Result) FromWire(w wire.Value) error { var err error @@ -17561,14 +17561,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17611,16 +17611,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -17979,14 +17979,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -18040,16 +18040,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error @@ -18380,14 +18380,14 @@ type Echo_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18416,16 +18416,16 @@ func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -18697,14 +18697,14 @@ type Echo_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18736,16 +18736,16 @@ func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -18950,14 +18950,14 @@ type Echo_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18983,16 +18983,16 @@ func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -19256,14 +19256,14 @@ type Echo_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19295,16 +19295,16 @@ func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -19513,14 +19513,14 @@ type Echo_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19546,16 +19546,16 @@ func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -19819,14 +19819,14 @@ type Echo_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19858,16 +19858,16 @@ func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -20088,14 +20088,14 @@ func Default_Echo_EchoEnum_Args() *Echo_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20127,16 +20127,16 @@ func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -20416,14 +20416,14 @@ type Echo_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20455,16 +20455,16 @@ func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -20673,14 +20673,14 @@ type Echo_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20706,16 +20706,16 @@ func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -20979,14 +20979,14 @@ type Echo_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21018,16 +21018,16 @@ func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -21236,14 +21236,14 @@ type Echo_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21269,16 +21269,16 @@ func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -21542,14 +21542,14 @@ type Echo_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21581,16 +21581,16 @@ func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -21837,14 +21837,14 @@ func (_Map_I32_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21901,16 +21901,16 @@ func _Map_I32_BarResponse_Read(m wire.MapItemList) (map[int32]*BarResponse, erro // An error is returned if we were unable to build a Echo_EchoI32Map_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Args) FromWire(w wire.Value) error { var err error @@ -22289,14 +22289,14 @@ type Echo_EchoI32Map_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22328,16 +22328,16 @@ func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32Map_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Result) FromWire(w wire.Value) error { var err error @@ -22542,14 +22542,14 @@ type Echo_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22575,16 +22575,16 @@ func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -22848,14 +22848,14 @@ type Echo_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22887,16 +22887,16 @@ func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -23105,14 +23105,14 @@ type Echo_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23138,16 +23138,16 @@ func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -23411,14 +23411,14 @@ type Echo_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23450,16 +23450,16 @@ func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -23668,14 +23668,14 @@ type Echo_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23701,16 +23701,16 @@ func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -23974,14 +23974,14 @@ type Echo_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24013,16 +24013,16 @@ func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -24231,14 +24231,14 @@ type Echo_EchoStringList_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24264,16 +24264,16 @@ func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -24542,14 +24542,14 @@ type Echo_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24581,16 +24581,16 @@ func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -24833,14 +24833,14 @@ func (_Map_String_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24897,16 +24897,16 @@ func _Map_String_BarResponse_Read(m wire.MapItemList) (map[string]*BarResponse, // An error is returned if we were unable to build a Echo_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -25272,14 +25272,14 @@ type Echo_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25311,16 +25311,16 @@ func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -25551,14 +25551,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25606,16 +25606,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -25963,14 +25963,14 @@ type Echo_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26002,16 +26002,16 @@ func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -26245,14 +26245,14 @@ func (_List_BarResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26296,16 +26296,16 @@ func _List_BarResponse_Read(l wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -26651,14 +26651,14 @@ type Echo_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26690,16 +26690,16 @@ func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -26950,14 +26950,14 @@ func (_Map_BarResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27023,16 +27023,16 @@ func _Map_BarResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a Echo_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -27469,14 +27469,14 @@ type Echo_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27508,16 +27508,16 @@ func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -27754,14 +27754,14 @@ func (_Set_BarResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27809,16 +27809,16 @@ func _Set_BarResponse_sliceType_Read(s wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -28176,14 +28176,14 @@ type Echo_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28215,16 +28215,16 @@ func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -28429,14 +28429,14 @@ type Echo_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28462,16 +28462,16 @@ func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -28735,14 +28735,14 @@ type Echo_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28774,16 +28774,16 @@ func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go b/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go index b53de2e66..6a6319ad1 100644 --- a/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go +++ b/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go b/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go index 6136ddb2d..94b7ce514 100644 --- a/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go +++ b/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go b/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go index 109ea1040..2196bf6a4 100644 --- a/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go +++ b/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go @@ -27,14 +27,14 @@ type Bounce_Bounce_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Bounce_Bounce_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go b/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go index 25f07523a..ef55415d0 100644 --- a/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go +++ b/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go @@ -27,14 +27,14 @@ type Echo_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Echo_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go b/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go index 8b2da3861..7a5e6f298 100644 --- a/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go +++ b/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go @@ -107,10 +107,10 @@ type FxEchoYARPCClientResult struct { // NewFxEchoYARPCClient provides a EchoYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCClient("service-name"), +// ... +// ) func NewFxEchoYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoYARPCClientParams) FxEchoYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxEchoYARPCProceduresResult struct { // NewFxEchoYARPCProcedures provides EchoYARPCServer procedures to an Fx application. // It expects a EchoYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCProcedures(), +// ... +// ) func NewFxEchoYARPCProcedures() interface{} { return func(params FxEchoYARPCProceduresParams) FxEchoYARPCProceduresResult { return FxEchoYARPCProceduresResult{ @@ -311,10 +311,10 @@ type FxEchoInternalYARPCClientResult struct { // NewFxEchoInternalYARPCClient provides a EchoInternalYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoInternalYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoInternalYARPCClient("service-name"), +// ... +// ) func NewFxEchoInternalYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoInternalYARPCClientParams) FxEchoInternalYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -360,10 +360,10 @@ type FxEchoInternalYARPCProceduresResult struct { // NewFxEchoInternalYARPCProcedures provides EchoInternalYARPCServer procedures to an Fx application. // It expects a EchoInternalYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoInternalYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoInternalYARPCProcedures(), +// ... +// ) func NewFxEchoInternalYARPCProcedures() interface{} { return func(params FxEchoInternalYARPCProceduresParams) FxEchoInternalYARPCProceduresResult { return FxEchoInternalYARPCProceduresResult{ diff --git a/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go b/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go index 20f065baa..cee0d9f40 100644 --- a/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go +++ b/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go @@ -107,10 +107,10 @@ type FxMirrorYARPCClientResult struct { // NewFxMirrorYARPCClient provides a MirrorYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// mirror.NewFxMirrorYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorYARPCClient("service-name"), +// ... +// ) func NewFxMirrorYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxMirrorYARPCClientParams) FxMirrorYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxMirrorYARPCProceduresResult struct { // NewFxMirrorYARPCProcedures provides MirrorYARPCServer procedures to an Fx application. // It expects a MirrorYARPCServer to be present in the container. // -// fx.Provide( -// mirror.NewFxMirrorYARPCProcedures(), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorYARPCProcedures(), +// ... +// ) func NewFxMirrorYARPCProcedures() interface{} { return func(params FxMirrorYARPCProceduresParams) FxMirrorYARPCProceduresResult { return FxMirrorYARPCProceduresResult{ @@ -311,10 +311,10 @@ type FxMirrorInternalYARPCClientResult struct { // NewFxMirrorInternalYARPCClient provides a MirrorInternalYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// mirror.NewFxMirrorInternalYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorInternalYARPCClient("service-name"), +// ... +// ) func NewFxMirrorInternalYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxMirrorInternalYARPCClientParams) FxMirrorInternalYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -360,10 +360,10 @@ type FxMirrorInternalYARPCProceduresResult struct { // NewFxMirrorInternalYARPCProcedures provides MirrorInternalYARPCServer procedures to an Fx application. // It expects a MirrorInternalYARPCServer to be present in the container. // -// fx.Provide( -// mirror.NewFxMirrorInternalYARPCProcedures(), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorInternalYARPCProcedures(), +// ... +// ) func NewFxMirrorInternalYARPCProcedures() interface{} { return func(params FxMirrorInternalYARPCProceduresParams) FxMirrorInternalYARPCProceduresResult { return FxMirrorInternalYARPCProceduresResult{ diff --git a/runtime/error.go b/runtime/error.go index 919733129..9b0f767f5 100644 --- a/runtime/error.go +++ b/runtime/error.go @@ -26,9 +26,11 @@ type ErrorType int const ( // TChannelError are errors of type tchannel.SystemError TChannelError ErrorType = iota + 1 + // ClientException are client exceptions defined in the // client IDL. ClientException + // BadResponse are errors reading client response such // as undefined exceptions, empty response. BadResponse @@ -36,17 +38,19 @@ const ( //go:generate stringer -type=ErrorType -// Error extends error interface to set meta fields about +// Error is a wrapper on go error to provide meta fields about // error that are logged to improve error debugging, as well // as to facilitate error grouping and filtering in logs. type Error interface { error - // ErrorLocation is used for logging. It is the module - // identifier that produced the error. It should be one - // of client, middleware, endpoint. + + // ErrorLocation is the module identifier that produced + // the error. It should be one of client, middleware, endpoint. ErrorLocation() string - // ErrorType is for error grouping. + + // ErrorType is used for error grouping. ErrorType() ErrorType - // Unwrap to enable usage of func errors.As + + // Unwrap returns wrapped error. Unwrap() error } diff --git a/runtime/error_builder.go b/runtime/error_builder.go index 1cb0db7ac..649604e59 100644 --- a/runtime/error_builder.go +++ b/runtime/error_builder.go @@ -20,82 +20,59 @@ package zanzibar -import "go.uber.org/zap" - -const ( - logFieldErrorLocation = "errorLocation" - logFieldErrorType = "errorType" -) - -// ErrorBuilder provides useful functions to use Error. +// ErrorBuilder wraps input error into Error. type ErrorBuilder interface { - Error(err error, errType ErrorType) Error - LogFieldErrorLocation(err error) zap.Field - LogFieldErrorType(err error) zap.Field + Error(err error, errType ErrorType) error + + Rebuild(zErr Error, err error) error } // NewErrorBuilder creates an instance of ErrorBuilder. // Input module id is used as error location for Errors // created by this builder. -// -// PseudoErrLocation is prefixed with "~" to identify -// logged error that is not created in the present module. func NewErrorBuilder(moduleClassName, moduleName string) ErrorBuilder { - return zErrorBuilder{ - errLocation: moduleClassName + "::" + moduleName, - pseudoErrLocation: "~" + moduleClassName + "::" + moduleName, + return errorBuilder{ + errLocation: moduleClassName + "::" + moduleName, } } -type zErrorBuilder struct { - errLocation, pseudoErrLocation string +type errorBuilder struct { + errLocation string } -type zError struct { +type wrappedError struct { error errLocation string errType ErrorType } -var _ Error = (*zError)(nil) -var _ ErrorBuilder = (*zErrorBuilder)(nil) +var _ Error = (*wrappedError)(nil) +var _ ErrorBuilder = (*errorBuilder)(nil) -func (zb zErrorBuilder) Error(err error, errType ErrorType) Error { - return zError{ +func (eb errorBuilder) Error(err error, errType ErrorType) error { + return wrappedError{ error: err, - errLocation: zb.errLocation, + errLocation: eb.errLocation, errType: errType, } } -func (zb zErrorBuilder) toError(err error) Error { - if zerr, ok := err.(Error); ok { - return zerr - } - return zError{ +func (eb errorBuilder) Rebuild(zErr Error, err error) error { + return wrappedError{ error: err, - errLocation: zb.pseudoErrLocation, + errLocation: zErr.ErrorLocation(), + errType: zErr.ErrorType(), } } -func (zb zErrorBuilder) LogFieldErrorLocation(err error) zap.Field { - zerr := zb.toError(err) - return zap.String(logFieldErrorLocation, zerr.ErrorLocation()) -} - -func (zb zErrorBuilder) LogFieldErrorType(err error) zap.Field { - zerr := zb.toError(err) - return zap.String(logFieldErrorType, zerr.ErrorType().String()) -} - -func (e zError) Unwrap() error { +func (e wrappedError) Unwrap() error { return e.error } -func (e zError) ErrorLocation() string { +func (e wrappedError) ErrorLocation() string { return e.errLocation } -func (e zError) ErrorType() ErrorType { +func (e wrappedError) ErrorType() ErrorType { return e.errType } diff --git a/runtime/error_builder_test.go b/runtime/error_builder_test.go index 1954f5588..e6d0b811e 100644 --- a/runtime/error_builder_test.go +++ b/runtime/error_builder_test.go @@ -22,50 +22,20 @@ package zanzibar_test import ( "errors" - "strconv" "testing" "github.com/stretchr/testify/assert" zanzibar "github.com/uber/zanzibar/runtime" - "go.uber.org/zap" ) func TestErrorBuilder(t *testing.T) { eb := zanzibar.NewErrorBuilder("endpoint", "foo") err := errors.New("test error") - zerr := eb.Error(err, zanzibar.TChannelError) + err2 := eb.Error(err, zanzibar.TChannelError) - assert.Equal(t, "endpoint::foo", zerr.ErrorLocation()) - assert.Equal(t, "TChannelError", zerr.ErrorType().String()) - assert.True(t, errors.Is(zerr, err)) -} - -func TestErrorBuilderLogFields(t *testing.T) { - eb := zanzibar.NewErrorBuilder("client", "bar") - testErr := errors.New("test error") - table := []struct { - err error - wantErrLocation string - wantErrType string - }{ - { - err: eb.Error(testErr, zanzibar.ClientException), - wantErrLocation: "client::bar", - wantErrType: "ClientException", - }, - { - err: testErr, - wantErrLocation: "~client::bar", - wantErrType: "ErrorType(0)", - }, - } - for i, tt := range table { - t.Run("test"+strconv.Itoa(i), func(t *testing.T) { - logFieldErrLocation := eb.LogFieldErrorLocation(tt.err) - logFieldErrType := eb.LogFieldErrorType(tt.err) - - assert.Equal(t, zap.String("errorLocation", tt.wantErrLocation), logFieldErrLocation) - assert.Equal(t, zap.String("errorType", tt.wantErrType), logFieldErrType) - }) - } + zErr, ok := err2.(zanzibar.Error) + assert.True(t, ok) + assert.Equal(t, "endpoint::foo", zErr.ErrorLocation()) + assert.Equal(t, "TChannelError", zErr.ErrorType().String()) + assert.True(t, errors.Is(err2, err)) } From 93af3487bc0e8c75997dc5d3a5f9b5ffb26addbe Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Wed, 28 Jun 2023 10:11:22 +0000 Subject: [PATCH 17/86] fix generated code --- codegen/template_bundle/template_files.go | 12 +- .../clients-idl/clients/bar/bar/bar.go | 2738 ++++++++--------- .../clients-idl/clients/baz/base/base.go | 224 +- .../clients-idl/clients/baz/baz/baz.go | 2250 +++++++------- .../clients/contacts/contacts/contacts.go | 354 +-- .../clients-idl/clients/corge/corge/corge.go | 386 +-- .../clients-idl/clients/echo/echo.pb.yarpc.go | 16 +- .../clients-idl/clients/foo/base/base/base.go | 32 +- .../clients-idl/clients/foo/foo/foo.go | 96 +- .../clients/googlenow/googlenow/googlenow.go | 130 +- .../clients-idl/clients/multi/multi/multi.go | 194 +- .../withexceptions/withexceptions.go | 160 +- .../endpoints/app/demo/endpoints/abc/abc.go | 64 +- .../endpoints-idl/endpoints/bar/bar/bar.go | 1426 ++++----- .../endpoints-idl/endpoints/baz/baz/baz.go | 1314 ++++---- .../endpoints/bounce/bounce/bounce.go | 64 +- .../clientless/clientless/clientless.go | 258 +- .../endpoints/contacts/contacts/contacts.go | 354 +-- .../endpoints/foo/base/base/base.go | 32 +- .../endpoints-idl/endpoints/foo/foo/foo.go | 96 +- .../googlenow/googlenow/googlenow.go | 130 +- .../endpoints/models/meta/meta.go | 224 +- .../endpoints/multi/multi/multi.go | 194 +- .../endpoints/tchannel/baz/baz/baz.go | 514 ++-- .../endpoints/tchannel/echo/echo/echo.go | 64 +- .../endpoints/tchannel/quux/quux/quux.go | 64 +- .../withexceptions/withexceptions.go | 160 +- .../build/gen-code/clients/bar/bar/bar.go | 2642 ++++++++-------- .../gen-code/clients/foo/base/base/base.go | 32 +- .../build/gen-code/clients/foo/foo/foo.go | 96 +- .../endpoints/bounce/bounce/bounce.go | 64 +- .../endpoints/tchannel/echo/echo/echo.go | 64 +- .../proto-gen/clients/echo/echo.pb.yarpc.go | 32 +- .../clients/mirror/mirror.pb.yarpc.go | 32 +- 34 files changed, 7257 insertions(+), 7255 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 164f2ac98..f085c375f 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -5014,11 +5014,13 @@ var _bindata = map[string]func() (*asset, error){ // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png +// +// data/ +// foo.txt +// img/ +// a.png +// b.png +// // then AssetDir("data") would return []string{"foo.txt", "img"} // AssetDir("data/img") would return []string{"a.png", "b.png"} // AssetDir("foo.txt") and AssetDir("notexist") would return an error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go b/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go index bda3ba24c..ccad0769e 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -781,14 +781,14 @@ type BarRequestRecur struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequestRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -828,16 +828,16 @@ func _BarRequestRecur_Read(w wire.Value) (*BarRequestRecur, error) { // An error is returned if we were unable to build a BarRequestRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequestRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequestRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequestRecur) FromWire(w wire.Value) error { var err error @@ -1132,14 +1132,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1282,16 +1282,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1994,14 +1994,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponseRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2052,16 +2052,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a BarResponseRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponseRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponseRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponseRecur) FromWire(w wire.Value) error { var err error @@ -2358,8 +2358,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -2416,10 +2416,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2436,16 +2436,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -2453,13 +2453,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2557,8 +2557,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -2615,10 +2615,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2635,16 +2635,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -2652,13 +2652,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2797,14 +2797,14 @@ type OptionalParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2832,16 +2832,16 @@ func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OptionalParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OptionalParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OptionalParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OptionalParamsStruct) FromWire(w wire.Value) error { var err error @@ -3017,14 +3017,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3050,16 +3050,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -3224,14 +3224,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -3281,16 +3281,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -3621,14 +3621,14 @@ type QueryParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -3685,16 +3685,16 @@ func (v *QueryParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -4078,14 +4078,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4127,16 +4127,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -4354,14 +4354,14 @@ type SeeOthersRedirection struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -4378,16 +4378,16 @@ func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SeeOthersRedirection struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SeeOthersRedirection -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SeeOthersRedirection +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SeeOthersRedirection) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4818,14 +4818,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4851,16 +4851,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -5129,14 +5129,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5174,16 +5174,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -5396,14 +5396,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5451,16 +5451,16 @@ func _OptionalParamsStruct_Read(w wire.Value) (*OptionalParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5842,14 +5842,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5881,16 +5881,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -6174,14 +6174,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -6464,16 +6464,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8511,14 +8511,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8550,16 +8550,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8767,14 +8767,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -8824,16 +8824,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9271,14 +9271,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9310,16 +9310,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9525,14 +9525,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9581,16 +9581,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9928,14 +9928,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9967,16 +9967,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -10182,14 +10182,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10229,16 +10229,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -10562,14 +10562,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10601,16 +10601,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -10816,14 +10816,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10865,16 +10865,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -11204,14 +11204,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11243,16 +11243,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -11457,14 +11457,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11492,16 +11492,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -11769,14 +11769,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11808,16 +11808,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -12051,14 +12051,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -12125,16 +12125,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12643,14 +12643,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12682,16 +12682,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12896,14 +12896,14 @@ type Bar_DeleteFoo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12929,16 +12929,16 @@ func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Args) FromWire(w wire.Value) error { var err error @@ -13192,14 +13192,14 @@ type Bar_DeleteFoo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13216,16 +13216,16 @@ func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13354,14 +13354,14 @@ type Bar_DeleteWithBody_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13395,16 +13395,16 @@ func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Args) FromWire(w wire.Value) error { var err error @@ -13716,14 +13716,14 @@ type Bar_DeleteWithBody_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13740,16 +13740,16 @@ func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13878,14 +13878,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13919,16 +13919,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -14240,14 +14240,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14264,16 +14264,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14400,14 +14400,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14424,16 +14424,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14666,14 +14666,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14727,16 +14727,16 @@ func _SeeOthersRedirection_Read(w wire.Value) (*SeeOthersRedirection, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -15073,14 +15073,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -15122,16 +15122,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -15537,14 +15537,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15584,16 +15584,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -15861,14 +15861,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15885,16 +15885,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -16115,14 +16115,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16162,16 +16162,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -16435,14 +16435,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -16459,16 +16459,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -16689,14 +16689,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16736,16 +16736,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -17010,14 +17010,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17046,16 +17046,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -17342,14 +17342,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17389,16 +17389,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -17663,14 +17663,14 @@ type Bar_NormalRecur_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17699,16 +17699,16 @@ func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Args) FromWire(w wire.Value) error { var err error @@ -17995,14 +17995,14 @@ type Bar_NormalRecur_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18048,16 +18048,16 @@ func _BarResponseRecur_Read(w wire.Value) (*BarResponseRecur, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Result) FromWire(w wire.Value) error { var err error @@ -18329,14 +18329,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18379,16 +18379,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -18747,14 +18747,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -18808,16 +18808,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error @@ -19148,14 +19148,14 @@ type Echo_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19184,16 +19184,16 @@ func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -19465,14 +19465,14 @@ type Echo_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19504,16 +19504,16 @@ func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -19718,14 +19718,14 @@ type Echo_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19751,16 +19751,16 @@ func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -20024,14 +20024,14 @@ type Echo_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20063,16 +20063,16 @@ func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -20281,14 +20281,14 @@ type Echo_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20314,16 +20314,16 @@ func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -20587,14 +20587,14 @@ type Echo_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20626,16 +20626,16 @@ func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -20856,14 +20856,14 @@ func Default_Echo_EchoEnum_Args() *Echo_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20895,16 +20895,16 @@ func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -21184,14 +21184,14 @@ type Echo_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21223,16 +21223,16 @@ func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -21441,14 +21441,14 @@ type Echo_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21474,16 +21474,16 @@ func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -21747,14 +21747,14 @@ type Echo_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21786,16 +21786,16 @@ func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -22004,14 +22004,14 @@ type Echo_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22037,16 +22037,16 @@ func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -22310,14 +22310,14 @@ type Echo_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22349,16 +22349,16 @@ func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -22605,14 +22605,14 @@ func (_Map_I32_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22669,16 +22669,16 @@ func _Map_I32_BarResponse_Read(m wire.MapItemList) (map[int32]*BarResponse, erro // An error is returned if we were unable to build a Echo_EchoI32Map_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Args) FromWire(w wire.Value) error { var err error @@ -23057,14 +23057,14 @@ type Echo_EchoI32Map_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23096,16 +23096,16 @@ func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32Map_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Result) FromWire(w wire.Value) error { var err error @@ -23310,14 +23310,14 @@ type Echo_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23343,16 +23343,16 @@ func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -23616,14 +23616,14 @@ type Echo_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23655,16 +23655,16 @@ func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -23873,14 +23873,14 @@ type Echo_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23906,16 +23906,16 @@ func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -24179,14 +24179,14 @@ type Echo_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24218,16 +24218,16 @@ func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -24436,14 +24436,14 @@ type Echo_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24469,16 +24469,16 @@ func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -24742,14 +24742,14 @@ type Echo_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24781,16 +24781,16 @@ func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -24999,14 +24999,14 @@ type Echo_EchoStringList_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25032,16 +25032,16 @@ func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -25310,14 +25310,14 @@ type Echo_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25349,16 +25349,16 @@ func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -25601,14 +25601,14 @@ func (_Map_String_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25665,16 +25665,16 @@ func _Map_String_BarResponse_Read(m wire.MapItemList) (map[string]*BarResponse, // An error is returned if we were unable to build a Echo_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -26040,14 +26040,14 @@ type Echo_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26079,16 +26079,16 @@ func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -26319,14 +26319,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26374,16 +26374,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -26731,14 +26731,14 @@ type Echo_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26770,16 +26770,16 @@ func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -27013,14 +27013,14 @@ func (_List_BarResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27064,16 +27064,16 @@ func _List_BarResponse_Read(l wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -27419,14 +27419,14 @@ type Echo_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27458,16 +27458,16 @@ func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -27718,14 +27718,14 @@ func (_Map_BarResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27791,16 +27791,16 @@ func _Map_BarResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a Echo_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -28237,14 +28237,14 @@ type Echo_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28276,16 +28276,16 @@ func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -28522,14 +28522,14 @@ func (_Set_BarResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28577,16 +28577,16 @@ func _Set_BarResponse_sliceType_Read(s wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -28944,14 +28944,14 @@ type Echo_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28983,16 +28983,16 @@ func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -29197,14 +29197,14 @@ type Echo_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -29230,16 +29230,16 @@ func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -29503,14 +29503,14 @@ type Echo_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -29542,16 +29542,16 @@ func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go index 595c9d0ab..b1bf4460d 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/base/base.go @@ -25,14 +25,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -230,14 +230,14 @@ type NestHeaders struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestHeaders) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -271,16 +271,16 @@ func (v *NestHeaders) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestHeaders struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestHeaders -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestHeaders +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestHeaders) FromWire(w wire.Value) error { var err error @@ -508,14 +508,14 @@ type NestedStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestedStruct) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -549,16 +549,16 @@ func (v *NestedStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestedStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestedStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestedStruct) FromWire(w wire.Value) error { var err error @@ -785,14 +785,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -818,16 +818,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -1000,14 +1000,14 @@ type TransHeaders struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeaders) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1050,16 +1050,16 @@ func _Wrapped_Read(w wire.Value) (*Wrapped, error) { // An error is returned if we were unable to build a TransHeaders struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeaders -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeaders +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeaders) FromWire(w wire.Value) error { var err error @@ -1288,14 +1288,14 @@ type TransStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransStruct) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1344,16 +1344,16 @@ func _NestedStruct_Read(w wire.Value) (*NestedStruct, error) { // An error is returned if we were unable to build a TransStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransStruct) FromWire(w wire.Value) error { var err error @@ -1680,14 +1680,14 @@ type Wrapped struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Wrapped) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1730,16 +1730,16 @@ func _NestHeaders_Read(w wire.Value) (*NestHeaders, error) { // An error is returned if we were unable to build a Wrapped struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Wrapped -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Wrapped +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Wrapped) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go index 60df83835..a8c591721 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/baz/baz/baz.go @@ -31,14 +31,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -247,14 +247,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -294,16 +294,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -570,8 +570,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -628,10 +628,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -648,16 +648,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -665,13 +665,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -762,14 +762,14 @@ type GetProfileRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileRequest) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -801,16 +801,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a GetProfileRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileRequest) FromWire(w wire.Value) error { var err error @@ -1007,14 +1007,14 @@ func (_List_Profile_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1064,16 +1064,16 @@ func _List_Profile_Read(l wire.ValueList) ([]*Profile, error) { // An error is returned if we were unable to build a GetProfileResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileResponse) FromWire(w wire.Value) error { var err error @@ -1322,14 +1322,14 @@ type HeaderSchema struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *HeaderSchema) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1346,16 +1346,16 @@ func (v *HeaderSchema) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a HeaderSchema struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v HeaderSchema -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v HeaderSchema +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *HeaderSchema) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1465,14 +1465,14 @@ type OtherAuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OtherAuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1498,16 +1498,16 @@ func (v *OtherAuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OtherAuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OtherAuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OtherAuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OtherAuthErr) FromWire(w wire.Value) error { var err error @@ -1679,14 +1679,14 @@ type Profile struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Profile) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1721,16 +1721,16 @@ func _Recur1_Read(w wire.Value) (*Recur1, error) { // An error is returned if we were unable to build a Profile struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Profile -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Profile +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Profile) FromWire(w wire.Value) error { var err error @@ -1944,14 +1944,14 @@ func (_Map_UUID_Recur2_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2014,16 +2014,16 @@ func _Map_UUID_Recur2_Read(m wire.MapItemList) (map[UUID]*Recur2, error) { // An error is returned if we were unable to build a Recur1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur1) FromWire(w wire.Value) error { var err error @@ -2294,14 +2294,14 @@ type Recur2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur2) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2344,16 +2344,16 @@ func _Recur3_Read(w wire.Value) (*Recur3, error) { // An error is returned if we were unable to build a Recur2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur2) FromWire(w wire.Value) error { var err error @@ -2580,14 +2580,14 @@ type Recur3 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur3) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2613,16 +2613,16 @@ func (v *Recur3) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Recur3 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur3 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur3 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur3) FromWire(w wire.Value) error { var err error @@ -2838,14 +2838,14 @@ type TransHeaderType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeaderType) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -2916,16 +2916,16 @@ func (v *TransHeaderType) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TransHeaderType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeaderType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeaderType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeaderType) FromWire(w wire.Value) error { var err error @@ -3438,14 +3438,14 @@ type SecondService_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3474,16 +3474,16 @@ func (v *SecondService_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -3755,14 +3755,14 @@ type SecondService_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3794,16 +3794,16 @@ func (v *SecondService_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -4008,14 +4008,14 @@ type SecondService_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4041,16 +4041,16 @@ func (v *SecondService_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -4314,14 +4314,14 @@ type SecondService_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4353,16 +4353,16 @@ func (v *SecondService_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -4581,14 +4581,14 @@ type SecondService_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4614,16 +4614,16 @@ func (v *SecondService_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -4887,14 +4887,14 @@ type SecondService_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4926,16 +4926,16 @@ func (v *SecondService_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -5156,14 +5156,14 @@ func Default_SecondService_EchoEnum_Args() *SecondService_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5201,16 +5201,16 @@ func _Fruit_Read(w wire.Value) (Fruit, error) { // An error is returned if we were unable to build a SecondService_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -5506,14 +5506,14 @@ type SecondService_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5545,16 +5545,16 @@ func (v *SecondService_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -5763,14 +5763,14 @@ type SecondService_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5796,16 +5796,16 @@ func (v *SecondService_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -6069,14 +6069,14 @@ type SecondService_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6108,16 +6108,16 @@ func (v *SecondService_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -6336,14 +6336,14 @@ type SecondService_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6369,16 +6369,16 @@ func (v *SecondService_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -6642,14 +6642,14 @@ type SecondService_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6681,16 +6681,16 @@ func (v *SecondService_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -6899,14 +6899,14 @@ type SecondService_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6932,16 +6932,16 @@ func (v *SecondService_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -7205,14 +7205,14 @@ type SecondService_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7244,16 +7244,16 @@ func (v *SecondService_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -7472,14 +7472,14 @@ type SecondService_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7505,16 +7505,16 @@ func (v *SecondService_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -7778,14 +7778,14 @@ type SecondService_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7817,16 +7817,16 @@ func (v *SecondService_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -8045,14 +8045,14 @@ type SecondService_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8078,16 +8078,16 @@ func (v *SecondService_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -8351,14 +8351,14 @@ type SecondService_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8390,16 +8390,16 @@ func (v *SecondService_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -8644,14 +8644,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8695,16 +8695,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a SecondService_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -9047,14 +9047,14 @@ type SecondService_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9086,16 +9086,16 @@ func (v *SecondService_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -9338,14 +9338,14 @@ func (_Map_String_BazResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9408,16 +9408,16 @@ func _Map_String_BazResponse_Read(m wire.MapItemList) (map[string]*base.BazRespo // An error is returned if we were unable to build a SecondService_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -9789,14 +9789,14 @@ type SecondService_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9828,16 +9828,16 @@ func (v *SecondService_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -10068,14 +10068,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10123,16 +10123,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a SecondService_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -10480,14 +10480,14 @@ type SecondService_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10519,16 +10519,16 @@ func (v *SecondService_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -10762,14 +10762,14 @@ func (_List_BazResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10813,16 +10813,16 @@ func _List_BazResponse_Read(l wire.ValueList) ([]*base.BazResponse, error) { // An error is returned if we were unable to build a SecondService_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -11168,14 +11168,14 @@ type SecondService_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11207,16 +11207,16 @@ func (v *SecondService_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -11467,14 +11467,14 @@ func (_Map_BazResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11540,16 +11540,16 @@ func _Map_BazResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a SecondService_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -11986,14 +11986,14 @@ type SecondService_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12025,16 +12025,16 @@ func (v *SecondService_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -12271,14 +12271,14 @@ func (_Set_BazResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12326,16 +12326,16 @@ func _Set_BazResponse_sliceType_Read(s wire.ValueList) ([]*base.BazResponse, err // An error is returned if we were unable to build a SecondService_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -12693,14 +12693,14 @@ type SecondService_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12732,16 +12732,16 @@ func (v *SecondService_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -12946,14 +12946,14 @@ type SecondService_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12985,16 +12985,16 @@ func _UUID_1_Read(w wire.Value) (base.UUID, error) { // An error is returned if we were unable to build a SecondService_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -13264,14 +13264,14 @@ type SecondService_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SecondService_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -13303,16 +13303,16 @@ func (v *SecondService_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SecondService_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SecondService_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SecondService_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SecondService_EchoTypedef_Result) FromWire(w wire.Value) error { var err error @@ -13533,14 +13533,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13591,16 +13591,16 @@ func _BazRequest_Read(w wire.Value) (*BazRequest, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -13999,14 +13999,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -14044,16 +14044,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -14266,14 +14266,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14318,16 +14318,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -14720,14 +14720,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -14759,16 +14759,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -14974,14 +14974,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15019,16 +15019,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -15387,14 +15387,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -15448,16 +15448,16 @@ func _OtherAuthErr_Read(w wire.Value) (*OtherAuthErr, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -15788,14 +15788,14 @@ type SimpleService_GetProfile_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -15830,16 +15830,16 @@ func _GetProfileRequest_Read(w wire.Value) (*GetProfileRequest, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Args) FromWire(w wire.Value) error { var err error @@ -16132,14 +16132,14 @@ type SimpleService_GetProfile_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16185,16 +16185,16 @@ func _GetProfileResponse_Read(w wire.Value) (*GetProfileResponse, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Result) FromWire(w wire.Value) error { var err error @@ -16465,14 +16465,14 @@ type SimpleService_HeaderSchema_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16507,16 +16507,16 @@ func _HeaderSchema_Read(w wire.Value) (*HeaderSchema, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Args) FromWire(w wire.Value) error { var err error @@ -16821,14 +16821,14 @@ type SimpleService_HeaderSchema_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -16876,16 +16876,16 @@ func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Result) FromWire(w wire.Value) error { var err error @@ -17209,14 +17209,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -17233,16 +17233,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -17448,14 +17448,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -17487,16 +17487,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -17700,14 +17700,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -17724,16 +17724,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -17956,14 +17956,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18009,16 +18009,16 @@ func _ServerErr_Read(w wire.Value) (*base.ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error @@ -18288,14 +18288,14 @@ type SimpleService_TestUuid_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -18312,16 +18312,16 @@ func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -18517,14 +18517,14 @@ type SimpleService_TestUuid_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -18541,16 +18541,16 @@ func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -18679,14 +18679,14 @@ type SimpleService_Trans_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -18729,16 +18729,16 @@ func _TransStruct_Read(w wire.Value) (*base.TransStruct, error) { // An error is returned if we were unable to build a SimpleService_Trans_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Args) FromWire(w wire.Value) error { var err error @@ -19097,14 +19097,14 @@ type SimpleService_Trans_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -19152,16 +19152,16 @@ func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Trans_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Result) FromWire(w wire.Value) error { var err error @@ -19486,14 +19486,14 @@ type SimpleService_TransHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19528,16 +19528,16 @@ func _TransHeaders_Read(w wire.Value) (*base.TransHeaders, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Args) FromWire(w wire.Value) error { var err error @@ -19842,14 +19842,14 @@ type SimpleService_TransHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -19897,16 +19897,16 @@ func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Result) FromWire(w wire.Value) error { var err error @@ -20234,14 +20234,14 @@ type SimpleService_TransHeadersNoReq_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -20299,16 +20299,16 @@ func _NestedStruct_Read(w wire.Value) (*base.NestedStruct, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Args) FromWire(w wire.Value) error { var err error @@ -20771,14 +20771,14 @@ type SimpleService_TransHeadersNoReq_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -20818,16 +20818,16 @@ func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Result) FromWire(w wire.Value) error { var err error @@ -21092,14 +21092,14 @@ type SimpleService_TransHeadersType_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21134,16 +21134,16 @@ func _TransHeaderType_Read(w wire.Value) (*TransHeaderType, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Args) FromWire(w wire.Value) error { var err error @@ -21448,14 +21448,14 @@ type SimpleService_TransHeadersType_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -21503,16 +21503,16 @@ func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Result) FromWire(w wire.Value) error { var err error @@ -21836,14 +21836,14 @@ type SimpleService_UrlTest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -21860,16 +21860,16 @@ func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -22065,14 +22065,14 @@ type SimpleService_UrlTest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -22089,16 +22089,16 @@ func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go b/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go index 41984a4b8..3671161ef 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts/contacts.go @@ -24,14 +24,14 @@ type BadRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BadRequest) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *BadRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BadRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BadRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BadRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BadRequest) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -207,14 +207,14 @@ func (_List_ContactFragment_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contact) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -280,16 +280,16 @@ func _ContactAttributes_Read(w wire.Value) (*ContactAttributes, error) { // An error is returned if we were unable to build a Contact struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contact -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contact +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contact) FromWire(w wire.Value) error { var err error @@ -603,14 +603,14 @@ type ContactAttributes struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactAttributes) ToWire() (wire.Value, error) { var ( fields [13]wire.Field @@ -734,16 +734,16 @@ func (v *ContactAttributes) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ContactAttributes struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactAttributes -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactAttributes) FromWire(w wire.Value) error { var err error @@ -1600,14 +1600,14 @@ type ContactFragment struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactFragment) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1649,16 +1649,16 @@ func _ContactFragmentType_Read(w wire.Value) (ContactFragmentType, error) { // An error is returned if we were unable to build a ContactFragment struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactFragment -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactFragment +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactFragment) FromWire(w wire.Value) error { var err error @@ -1942,14 +1942,14 @@ type NotFound struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotFound) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1966,16 +1966,16 @@ func (v *NotFound) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotFound struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotFound -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotFound +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotFound) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2125,14 +2125,14 @@ func (_List_Contact_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsRequest) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2189,16 +2189,16 @@ func _List_Contact_Read(l wire.ValueList) ([]*Contact, error) { // An error is returned if we were unable to build a SaveContactsRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsRequest) FromWire(w wire.Value) error { var err error @@ -2496,14 +2496,14 @@ type SaveContactsResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsResponse) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2520,16 +2520,16 @@ func (v *SaveContactsResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SaveContactsResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsResponse) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2690,14 +2690,14 @@ type Contacts_SaveContacts_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2732,16 +2732,16 @@ func _SaveContactsRequest_Read(w wire.Value) (*SaveContactsRequest, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Args) FromWire(w wire.Value) error { var err error @@ -3046,14 +3046,14 @@ type Contacts_SaveContacts_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3119,16 +3119,16 @@ func _NotFound_Read(w wire.Value) (*NotFound, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Result) FromWire(w wire.Value) error { var err error @@ -3470,14 +3470,14 @@ type Contacts_TestUrlUrl_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3494,16 +3494,16 @@ func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3709,14 +3709,14 @@ type Contacts_TestUrlUrl_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3748,16 +3748,16 @@ func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go b/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go index 5f1599bcf..11f173d5d 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge/corge.go @@ -24,14 +24,14 @@ type Foo struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Foo) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *Foo) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Foo struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Foo -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Foo +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Foo) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -166,14 +166,14 @@ type NotModified struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotModified) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -190,16 +190,16 @@ func (v *NotModified) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotModified struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotModified -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotModified +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotModified) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -322,14 +322,14 @@ type Corge_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -355,16 +355,16 @@ func (v *Corge_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -628,14 +628,14 @@ type Corge_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -667,16 +667,16 @@ func (v *Corge_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -895,14 +895,14 @@ type Corge_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -928,16 +928,16 @@ func (v *Corge_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -1201,14 +1201,14 @@ type Corge_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1240,16 +1240,16 @@ func (v *Corge_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -1468,14 +1468,14 @@ type Corge_NoContent_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContent_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1501,16 +1501,16 @@ func (v *Corge_NoContent_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContent_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContent_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContent_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContent_Args) FromWire(w wire.Value) error { var err error @@ -1779,14 +1779,14 @@ type Corge_NoContent_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContent_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1824,16 +1824,16 @@ func _NotModified_Read(w wire.Value) (*NotModified, error) { // An error is returned if we were unable to build a Corge_NoContent_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContent_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContent_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContent_Result) FromWire(w wire.Value) error { var err error @@ -2044,14 +2044,14 @@ type Corge_NoContentNoException_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentNoException_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2077,16 +2077,16 @@ func (v *Corge_NoContentNoException_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentNoException_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentNoException_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentNoException_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentNoException_Args) FromWire(w wire.Value) error { var err error @@ -2340,14 +2340,14 @@ type Corge_NoContentNoException_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentNoException_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2364,16 +2364,16 @@ func (v *Corge_NoContentNoException_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentNoException_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentNoException_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentNoException_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentNoException_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2501,14 +2501,14 @@ type Corge_NoContentOnException_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentOnException_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2534,16 +2534,16 @@ func (v *Corge_NoContentOnException_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Corge_NoContentOnException_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentOnException_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentOnException_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentOnException_Args) FromWire(w wire.Value) error { var err error @@ -2822,14 +2822,14 @@ type Corge_NoContentOnException_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Corge_NoContentOnException_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2875,16 +2875,16 @@ func _Foo_Read(w wire.Value) (*Foo, error) { // An error is returned if we were unable to build a Corge_NoContentOnException_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Corge_NoContentOnException_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Corge_NoContentOnException_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Corge_NoContentOnException_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go b/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go index 5fcf5f61d..ac9418fe6 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/echo/echo.pb.yarpc.go @@ -107,10 +107,10 @@ type FxEchoYARPCClientResult struct { // NewFxEchoYARPCClient provides a EchoYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCClient("service-name"), +// ... +// ) func NewFxEchoYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoYARPCClientParams) FxEchoYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxEchoYARPCProceduresResult struct { // NewFxEchoYARPCProcedures provides EchoYARPCServer procedures to an Fx application. // It expects a EchoYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCProcedures(), +// ... +// ) func NewFxEchoYARPCProcedures() interface{} { return func(params FxEchoYARPCProceduresParams) FxEchoYARPCProceduresResult { return FxEchoYARPCProceduresResult{ diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go index 6a6319ad1..b53de2e66 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go index 1dc2efe9d..952c40476 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go b/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go index b5d3d057a..90f9d62d5 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow/googlenow.go @@ -27,14 +27,14 @@ type GoogleNowService_AddCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_AddCredentials_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *GoogleNowService_AddCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_AddCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_AddCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_AddCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_AddCredentials_Args) FromWire(w wire.Value) error { var err error @@ -323,14 +323,14 @@ type GoogleNowService_AddCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_AddCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -347,16 +347,16 @@ func (v *GoogleNowService_AddCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_AddCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_AddCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_AddCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_AddCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -483,14 +483,14 @@ type GoogleNowService_CheckCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_CheckCredentials_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -507,16 +507,16 @@ func (v *GoogleNowService_CheckCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNowService_CheckCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_CheckCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_CheckCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_CheckCredentials_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -712,14 +712,14 @@ type GoogleNowService_CheckCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNowService_CheckCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -736,16 +736,16 @@ func (v *GoogleNowService_CheckCredentials_Result) ToWire() (wire.Value, error) // An error is returned if we were unable to build a GoogleNowService_CheckCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNowService_CheckCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNowService_CheckCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNowService_CheckCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go b/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go index 669caf5c0..3cc22c40a 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/multi/multi/multi.go @@ -26,14 +26,14 @@ type ServiceABack_HelloA_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceABack_HelloA_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *ServiceABack_HelloA_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceABack_HelloA_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceABack_HelloA_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceABack_HelloA_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceABack_HelloA_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type ServiceABack_HelloA_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceABack_HelloA_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *ServiceABack_HelloA_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceABack_HelloA_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceABack_HelloA_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceABack_HelloA_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceABack_HelloA_Result) FromWire(w wire.Value) error { var err error @@ -531,14 +531,14 @@ type ServiceBBack_HelloB_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBBack_HelloB_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -555,16 +555,16 @@ func (v *ServiceBBack_HelloB_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBBack_HelloB_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBBack_HelloB_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBBack_HelloB_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBBack_HelloB_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -770,14 +770,14 @@ type ServiceBBack_HelloB_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBBack_HelloB_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -809,16 +809,16 @@ func (v *ServiceBBack_HelloB_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBBack_HelloB_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBBack_HelloB_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBBack_HelloB_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBBack_HelloB_Result) FromWire(w wire.Value) error { var err error @@ -1026,14 +1026,14 @@ type ServiceCBack_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCBack_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1050,16 +1050,16 @@ func (v *ServiceCBack_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCBack_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCBack_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCBack_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCBack_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1265,14 +1265,14 @@ type ServiceCBack_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCBack_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1304,16 +1304,16 @@ func (v *ServiceCBack_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCBack_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCBack_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCBack_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCBack_Hello_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go b/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go index c93f1aa61..9bf9bc20f 100644 --- a/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions/withexceptions.go @@ -25,14 +25,14 @@ type ExceptionType1 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ExceptionType1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *ExceptionType1) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ExceptionType1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ExceptionType1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ExceptionType1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ExceptionType1) FromWire(w wire.Value) error { var err error @@ -239,14 +239,14 @@ type ExceptionType2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ExceptionType2) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -272,16 +272,16 @@ func (v *ExceptionType2) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ExceptionType2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ExceptionType2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ExceptionType2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ExceptionType2) FromWire(w wire.Value) error { var err error @@ -452,14 +452,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -476,16 +476,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -597,14 +597,14 @@ type WithExceptions_Func1_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -621,16 +621,16 @@ func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -863,14 +863,14 @@ type WithExceptions_Func1_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -936,16 +936,16 @@ func _ExceptionType2_Read(w wire.Value) (*ExceptionType2, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go index f113f39ce..d92699ddb 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/app/demo/endpoints/abc/abc.go @@ -26,14 +26,14 @@ type AppDemoService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AppDemoService_Call_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *AppDemoService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AppDemoService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AppDemoService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AppDemoService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AppDemoService_Call_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type AppDemoService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AppDemoService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *AppDemoService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AppDemoService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AppDemoService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AppDemoService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AppDemoService_Call_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go index b1186bbfd..32e9119c1 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -856,14 +856,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1006,16 +1006,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1698,8 +1698,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -1756,10 +1756,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -1776,16 +1776,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -1793,13 +1793,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -1897,8 +1897,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -1955,10 +1955,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -1975,16 +1975,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -1992,13 +1992,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2137,14 +2137,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2170,16 +2170,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -2344,14 +2344,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -2401,16 +2401,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -2777,14 +2777,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -2859,16 +2859,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -3326,14 +3326,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -3375,16 +3375,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -3602,14 +3602,14 @@ type SeeOthersRedirection struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3626,16 +3626,16 @@ func (v *SeeOthersRedirection) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SeeOthersRedirection struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SeeOthersRedirection -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SeeOthersRedirection +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SeeOthersRedirection) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4066,14 +4066,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4099,16 +4099,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -4377,14 +4377,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4422,16 +4422,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -4643,14 +4643,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4684,16 +4684,16 @@ func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5015,14 +5015,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5054,16 +5054,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -5347,14 +5347,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -5637,16 +5637,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -7684,14 +7684,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7723,16 +7723,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -7940,14 +7940,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -7997,16 +7997,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8444,14 +8444,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8483,16 +8483,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8698,14 +8698,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -8754,16 +8754,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9101,14 +9101,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9140,16 +9140,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9355,14 +9355,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9402,16 +9402,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -9735,14 +9735,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9774,16 +9774,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -9989,14 +9989,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10038,16 +10038,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -10377,14 +10377,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10416,16 +10416,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -10630,14 +10630,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10665,16 +10665,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -10942,14 +10942,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10981,16 +10981,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -11224,14 +11224,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -11298,16 +11298,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -11816,14 +11816,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11855,16 +11855,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12070,14 +12070,14 @@ type Bar_DeleteWithBody_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -12111,16 +12111,16 @@ func (v *Bar_DeleteWithBody_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Args) FromWire(w wire.Value) error { var err error @@ -12432,14 +12432,14 @@ type Bar_DeleteWithBody_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12456,16 +12456,16 @@ func (v *Bar_DeleteWithBody_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithBody_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithBody_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithBody_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithBody_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -12594,14 +12594,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -12635,16 +12635,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12956,14 +12956,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12980,16 +12980,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13116,14 +13116,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13140,16 +13140,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13382,14 +13382,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13443,16 +13443,16 @@ func _SeeOthersRedirection_Read(w wire.Value) (*SeeOthersRedirection, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -13789,14 +13789,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -13838,16 +13838,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -14253,14 +14253,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14300,16 +14300,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -14577,14 +14577,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -14601,16 +14601,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -14831,14 +14831,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14878,16 +14878,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -15151,14 +15151,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15175,16 +15175,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15405,14 +15405,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15452,16 +15452,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -15726,14 +15726,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -15762,16 +15762,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -16058,14 +16058,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16105,16 +16105,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -16380,14 +16380,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16430,16 +16430,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -16798,14 +16798,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -16859,16 +16859,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go index 936aeb2b6..7f8322101 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/baz/baz/baz.go @@ -25,14 +25,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -241,14 +241,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -288,16 +288,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -557,14 +557,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -590,16 +590,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -761,14 +761,14 @@ type GetProfileRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileRequest) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -800,16 +800,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a GetProfileRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileRequest) FromWire(w wire.Value) error { var err error @@ -1006,14 +1006,14 @@ func (_List_Profile_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GetProfileResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1063,16 +1063,16 @@ func _List_Profile_Read(l wire.ValueList) ([]*Profile, error) { // An error is returned if we were unable to build a GetProfileResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GetProfileResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GetProfileResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GetProfileResponse) FromWire(w wire.Value) error { var err error @@ -1321,14 +1321,14 @@ type HeaderSchema struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *HeaderSchema) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1345,16 +1345,16 @@ func (v *HeaderSchema) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a HeaderSchema struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v HeaderSchema -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v HeaderSchema +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *HeaderSchema) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1465,14 +1465,14 @@ type NestedStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NestedStruct) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1506,16 +1506,16 @@ func (v *NestedStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NestedStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NestedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NestedStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NestedStruct) FromWire(w wire.Value) error { var err error @@ -1742,14 +1742,14 @@ type OtherAuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OtherAuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1775,16 +1775,16 @@ func (v *OtherAuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OtherAuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OtherAuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OtherAuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OtherAuthErr) FromWire(w wire.Value) error { var err error @@ -1956,14 +1956,14 @@ type Profile struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Profile) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1998,16 +1998,16 @@ func _Recur1_Read(w wire.Value) (*Recur1, error) { // An error is returned if we were unable to build a Profile struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Profile -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Profile +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Profile) FromWire(w wire.Value) error { var err error @@ -2221,14 +2221,14 @@ func (_Map_UUID_Recur2_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2291,16 +2291,16 @@ func _Map_UUID_Recur2_Read(m wire.MapItemList) (map[UUID]*Recur2, error) { // An error is returned if we were unable to build a Recur1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur1) FromWire(w wire.Value) error { var err error @@ -2571,14 +2571,14 @@ type Recur2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur2) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2622,16 +2622,16 @@ func _Recur3_Read(w wire.Value) (*Recur3, error) { // An error is returned if we were unable to build a Recur2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur2) FromWire(w wire.Value) error { var err error @@ -2864,14 +2864,14 @@ type Recur3 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Recur3) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2897,16 +2897,16 @@ func (v *Recur3) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Recur3 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Recur3 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Recur3 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Recur3) FromWire(w wire.Value) error { var err error @@ -3068,14 +3068,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3101,16 +3101,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -3281,14 +3281,14 @@ type TransHeader struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransHeader) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3305,16 +3305,16 @@ func (v *TransHeader) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TransHeader struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransHeader -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransHeader +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransHeader) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3426,14 +3426,14 @@ type TransStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TransStruct) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3482,16 +3482,16 @@ func _NestedStruct_Read(w wire.Value) (*NestedStruct, error) { // An error is returned if we were unable to build a TransStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TransStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TransStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TransStruct) FromWire(w wire.Value) error { var err error @@ -3822,14 +3822,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3880,16 +3880,16 @@ func _BazRequest_Read(w wire.Value) (*BazRequest, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -4308,14 +4308,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4353,16 +4353,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -4575,14 +4575,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -4627,16 +4627,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -5029,14 +5029,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5068,16 +5068,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -5283,14 +5283,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -5328,16 +5328,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -5696,14 +5696,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5763,16 +5763,16 @@ func _OtherAuthErr_Read(w wire.Value) (*OtherAuthErr, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -6109,14 +6109,14 @@ type SimpleService_GetProfile_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6151,16 +6151,16 @@ func _GetProfileRequest_Read(w wire.Value) (*GetProfileRequest, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Args) FromWire(w wire.Value) error { var err error @@ -6453,14 +6453,14 @@ type SimpleService_GetProfile_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_GetProfile_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -6506,16 +6506,16 @@ func _GetProfileResponse_Read(w wire.Value) (*GetProfileResponse, error) { // An error is returned if we were unable to build a SimpleService_GetProfile_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_GetProfile_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_GetProfile_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_GetProfile_Result) FromWire(w wire.Value) error { var err error @@ -6786,14 +6786,14 @@ type SimpleService_HeaderSchema_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -6828,16 +6828,16 @@ func _HeaderSchema_Read(w wire.Value) (*HeaderSchema, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Args) FromWire(w wire.Value) error { var err error @@ -7142,14 +7142,14 @@ type SimpleService_HeaderSchema_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -7197,16 +7197,16 @@ func (v *SimpleService_HeaderSchema_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_HeaderSchema_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_HeaderSchema_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_HeaderSchema_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_HeaderSchema_Result) FromWire(w wire.Value) error { var err error @@ -7530,14 +7530,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -7554,16 +7554,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -7769,14 +7769,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -7808,16 +7808,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -8021,14 +8021,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8045,16 +8045,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -8277,14 +8277,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -8330,16 +8330,16 @@ func _ServerErr_Read(w wire.Value) (*ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error @@ -8609,14 +8609,14 @@ type SimpleService_TestUuid_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8633,16 +8633,16 @@ func (v *SimpleService_TestUuid_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -8838,14 +8838,14 @@ type SimpleService_TestUuid_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -8862,16 +8862,16 @@ func (v *SimpleService_TestUuid_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TestUuid_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TestUuid_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TestUuid_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TestUuid_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -9000,14 +9000,14 @@ type SimpleService_Trans_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9050,16 +9050,16 @@ func _TransStruct_Read(w wire.Value) (*TransStruct, error) { // An error is returned if we were unable to build a SimpleService_Trans_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Args) FromWire(w wire.Value) error { var err error @@ -9418,14 +9418,14 @@ type SimpleService_Trans_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -9473,16 +9473,16 @@ func (v *SimpleService_Trans_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Trans_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Trans_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Trans_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Trans_Result) FromWire(w wire.Value) error { var err error @@ -9807,14 +9807,14 @@ type SimpleService_TransHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9849,16 +9849,16 @@ func _TransHeader_Read(w wire.Value) (*TransHeader, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Args) FromWire(w wire.Value) error { var err error @@ -10163,14 +10163,14 @@ type SimpleService_TransHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -10218,16 +10218,16 @@ func (v *SimpleService_TransHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeaders_Result) FromWire(w wire.Value) error { var err error @@ -10551,14 +10551,14 @@ type SimpleService_TransHeadersNoReq_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -10575,16 +10575,16 @@ func (v *SimpleService_TransHeadersNoReq_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -10805,14 +10805,14 @@ type SimpleService_TransHeadersNoReq_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10852,16 +10852,16 @@ func (v *SimpleService_TransHeadersNoReq_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersNoReq_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersNoReq_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersNoReq_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersNoReq_Result) FromWire(w wire.Value) error { var err error @@ -11126,14 +11126,14 @@ type SimpleService_TransHeadersType_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11162,16 +11162,16 @@ func (v *SimpleService_TransHeadersType_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Args) FromWire(w wire.Value) error { var err error @@ -11470,14 +11470,14 @@ type SimpleService_TransHeadersType_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -11525,16 +11525,16 @@ func (v *SimpleService_TransHeadersType_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_TransHeadersType_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_TransHeadersType_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_TransHeadersType_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_TransHeadersType_Result) FromWire(w wire.Value) error { var err error @@ -11858,14 +11858,14 @@ type SimpleService_UrlTest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -11882,16 +11882,16 @@ func (v *SimpleService_UrlTest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -12087,14 +12087,14 @@ type SimpleService_UrlTest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -12111,16 +12111,16 @@ func (v *SimpleService_UrlTest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_UrlTest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_UrlTest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_UrlTest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_UrlTest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go index 2196bf6a4..109ea1040 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/bounce/bounce/bounce.go @@ -27,14 +27,14 @@ type Bounce_Bounce_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Bounce_Bounce_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go index 78d51e070..b63d2761f 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/clientless/clientless/clientless.go @@ -26,14 +26,14 @@ type Request struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Request) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -69,16 +69,16 @@ func (v *Request) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Request struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Request -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Request +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Request) FromWire(w wire.Value) error { var err error @@ -310,14 +310,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -353,16 +353,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { var err error @@ -587,14 +587,14 @@ type Clientless_Beta_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_Beta_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -636,16 +636,16 @@ func _Request_Read(w wire.Value) (*Request, error) { // An error is returned if we were unable to build a Clientless_Beta_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_Beta_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_Beta_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_Beta_Args) FromWire(w wire.Value) error { var err error @@ -973,14 +973,14 @@ type Clientless_Beta_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_Beta_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1018,16 +1018,16 @@ func _Response_Read(w wire.Value) (*Response, error) { // An error is returned if we were unable to build a Clientless_Beta_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_Beta_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_Beta_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_Beta_Result) FromWire(w wire.Value) error { var err error @@ -1239,14 +1239,14 @@ type Clientless_ClientlessArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_ClientlessArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1280,16 +1280,16 @@ func (v *Clientless_ClientlessArgWithHeaders_Args) ToWire() (wire.Value, error) // An error is returned if we were unable to build a Clientless_ClientlessArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_ClientlessArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_ClientlessArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_ClientlessArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -1611,14 +1611,14 @@ type Clientless_ClientlessArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_ClientlessArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1650,16 +1650,16 @@ func (v *Clientless_ClientlessArgWithHeaders_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Clientless_ClientlessArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_ClientlessArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_ClientlessArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_ClientlessArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -1864,14 +1864,14 @@ type Clientless_EmptyclientlessRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_EmptyclientlessRequest_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1899,16 +1899,16 @@ func (v *Clientless_EmptyclientlessRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Clientless_EmptyclientlessRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_EmptyclientlessRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_EmptyclientlessRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_EmptyclientlessRequest_Args) FromWire(w wire.Value) error { var err error @@ -2166,14 +2166,14 @@ type Clientless_EmptyclientlessRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Clientless_EmptyclientlessRequest_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2190,16 +2190,16 @@ func (v *Clientless_EmptyclientlessRequest_Result) ToWire() (wire.Value, error) // An error is returned if we were unable to build a Clientless_EmptyclientlessRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Clientless_EmptyclientlessRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Clientless_EmptyclientlessRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Clientless_EmptyclientlessRequest_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go index 41984a4b8..3671161ef 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/contacts/contacts/contacts.go @@ -24,14 +24,14 @@ type BadRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BadRequest) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -48,16 +48,16 @@ func (v *BadRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BadRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BadRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BadRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BadRequest) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -207,14 +207,14 @@ func (_List_ContactFragment_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contact) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -280,16 +280,16 @@ func _ContactAttributes_Read(w wire.Value) (*ContactAttributes, error) { // An error is returned if we were unable to build a Contact struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contact -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contact +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contact) FromWire(w wire.Value) error { var err error @@ -603,14 +603,14 @@ type ContactAttributes struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactAttributes) ToWire() (wire.Value, error) { var ( fields [13]wire.Field @@ -734,16 +734,16 @@ func (v *ContactAttributes) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ContactAttributes struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactAttributes -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactAttributes +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactAttributes) FromWire(w wire.Value) error { var err error @@ -1600,14 +1600,14 @@ type ContactFragment struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ContactFragment) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -1649,16 +1649,16 @@ func _ContactFragmentType_Read(w wire.Value) (ContactFragmentType, error) { // An error is returned if we were unable to build a ContactFragment struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ContactFragment -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ContactFragment +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ContactFragment) FromWire(w wire.Value) error { var err error @@ -1942,14 +1942,14 @@ type NotFound struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *NotFound) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1966,16 +1966,16 @@ func (v *NotFound) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a NotFound struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v NotFound -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v NotFound +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *NotFound) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2125,14 +2125,14 @@ func (_List_Contact_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsRequest) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2189,16 +2189,16 @@ func _List_Contact_Read(l wire.ValueList) ([]*Contact, error) { // An error is returned if we were unable to build a SaveContactsRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsRequest) FromWire(w wire.Value) error { var err error @@ -2496,14 +2496,14 @@ type SaveContactsResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SaveContactsResponse) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -2520,16 +2520,16 @@ func (v *SaveContactsResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SaveContactsResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SaveContactsResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SaveContactsResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SaveContactsResponse) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -2690,14 +2690,14 @@ type Contacts_SaveContacts_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2732,16 +2732,16 @@ func _SaveContactsRequest_Read(w wire.Value) (*SaveContactsRequest, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Args) FromWire(w wire.Value) error { var err error @@ -3046,14 +3046,14 @@ type Contacts_SaveContacts_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_SaveContacts_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -3119,16 +3119,16 @@ func _NotFound_Read(w wire.Value) (*NotFound, error) { // An error is returned if we were unable to build a Contacts_SaveContacts_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_SaveContacts_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_SaveContacts_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_SaveContacts_Result) FromWire(w wire.Value) error { var err error @@ -3470,14 +3470,14 @@ type Contacts_TestUrlUrl_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3494,16 +3494,16 @@ func (v *Contacts_TestUrlUrl_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -3709,14 +3709,14 @@ type Contacts_TestUrlUrl_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3748,16 +3748,16 @@ func (v *Contacts_TestUrlUrl_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Contacts_TestUrlUrl_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Contacts_TestUrlUrl_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Contacts_TestUrlUrl_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Contacts_TestUrlUrl_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go index 6a6319ad1..b53de2e66 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go index 2fe5c0dfc..c5c2ee49d 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go index 83aa729bd..5159ffae5 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/googlenow/googlenow/googlenow.go @@ -27,14 +27,14 @@ type GoogleNow_AddCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_AddCredentials_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *GoogleNow_AddCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_AddCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_AddCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_AddCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_AddCredentials_Args) FromWire(w wire.Value) error { var err error @@ -323,14 +323,14 @@ type GoogleNow_AddCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_AddCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -347,16 +347,16 @@ func (v *GoogleNow_AddCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_AddCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_AddCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_AddCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_AddCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -483,14 +483,14 @@ type GoogleNow_CheckCredentials_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_CheckCredentials_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -507,16 +507,16 @@ func (v *GoogleNow_CheckCredentials_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_CheckCredentials_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_CheckCredentials_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_CheckCredentials_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_CheckCredentials_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -712,14 +712,14 @@ type GoogleNow_CheckCredentials_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *GoogleNow_CheckCredentials_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -736,16 +736,16 @@ func (v *GoogleNow_CheckCredentials_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a GoogleNow_CheckCredentials_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v GoogleNow_CheckCredentials_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v GoogleNow_CheckCredentials_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *GoogleNow_CheckCredentials_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go index 0c5f9cfa0..65ebdf150 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/models/meta/meta.go @@ -26,14 +26,14 @@ type Dgx struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Dgx) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -74,16 +74,16 @@ func (v *Dgx) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Dgx struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Dgx -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Dgx +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Dgx) FromWire(w wire.Value) error { var err error @@ -360,14 +360,14 @@ type Fred struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Fred) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -400,16 +400,16 @@ func (v *Fred) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Fred struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Fred -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Fred +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Fred) FromWire(w wire.Value) error { var err error @@ -621,14 +621,14 @@ type Garply struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Garply) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -664,16 +664,16 @@ func (v *Garply) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Garply struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Garply -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Garply +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Garply) FromWire(w wire.Value) error { var err error @@ -905,14 +905,14 @@ type Grault struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Grault) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -948,16 +948,16 @@ func (v *Grault) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Grault struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Grault -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Grault +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Grault) FromWire(w wire.Value) error { var err error @@ -1178,14 +1178,14 @@ type Thud struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Thud) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1213,16 +1213,16 @@ func (v *Thud) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Thud struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Thud -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Thud +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Thud) FromWire(w wire.Value) error { var err error @@ -1388,14 +1388,14 @@ type TokenOnly struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *TokenOnly) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1421,16 +1421,16 @@ func (v *TokenOnly) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a TokenOnly struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v TokenOnly -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v TokenOnly +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *TokenOnly) FromWire(w wire.Value) error { var err error @@ -1592,14 +1592,14 @@ type UUIDOnly struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *UUIDOnly) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1625,16 +1625,16 @@ func (v *UUIDOnly) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a UUIDOnly struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v UUIDOnly -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v UUIDOnly +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *UUIDOnly) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go index 0eb0fd252..d8a9090d3 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/multi/multi/multi.go @@ -26,14 +26,14 @@ type ServiceAFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceAFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -50,16 +50,16 @@ func (v *ServiceAFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceAFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceAFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceAFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceAFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -265,14 +265,14 @@ type ServiceAFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceAFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -304,16 +304,16 @@ func (v *ServiceAFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceAFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceAFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceAFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceAFront_Hello_Result) FromWire(w wire.Value) error { var err error @@ -531,14 +531,14 @@ type ServiceBFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -555,16 +555,16 @@ func (v *ServiceBFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -770,14 +770,14 @@ type ServiceBFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceBFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -809,16 +809,16 @@ func (v *ServiceBFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceBFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceBFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceBFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceBFront_Hello_Result) FromWire(w wire.Value) error { var err error @@ -1026,14 +1026,14 @@ type ServiceCFront_Hello_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCFront_Hello_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -1050,16 +1050,16 @@ func (v *ServiceCFront_Hello_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCFront_Hello_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCFront_Hello_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCFront_Hello_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCFront_Hello_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -1265,14 +1265,14 @@ type ServiceCFront_Hello_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServiceCFront_Hello_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1304,16 +1304,16 @@ func (v *ServiceCFront_Hello_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServiceCFront_Hello_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServiceCFront_Hello_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServiceCFront_Hello_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServiceCFront_Hello_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go index 9ce0e679b..57d2e4fb5 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/baz/baz/baz.go @@ -25,14 +25,14 @@ type AuthErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *AuthErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *AuthErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a AuthErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v AuthErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v AuthErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *AuthErr) FromWire(w wire.Value) error { var err error @@ -241,14 +241,14 @@ type BazRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazRequest) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -288,16 +288,16 @@ func (v *BazRequest) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazRequest) FromWire(w wire.Value) error { var err error @@ -557,14 +557,14 @@ type BazResponse struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BazResponse) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -590,16 +590,16 @@ func (v *BazResponse) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BazResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BazResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BazResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BazResponse) FromWire(w wire.Value) error { var err error @@ -761,14 +761,14 @@ type ServerErr struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ServerErr) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -794,16 +794,16 @@ func (v *ServerErr) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ServerErr struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ServerErr -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ServerErr +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ServerErr) FromWire(w wire.Value) error { var err error @@ -1028,14 +1028,14 @@ type SimpleService_AnotherCall_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1092,16 +1092,16 @@ func _UUID_Read(w wire.Value) (UUID, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Args) FromWire(w wire.Value) error { var err error @@ -1526,14 +1526,14 @@ type SimpleService_AnotherCall_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_AnotherCall_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -1571,16 +1571,16 @@ func _AuthErr_Read(w wire.Value) (*AuthErr, error) { // An error is returned if we were unable to build a SimpleService_AnotherCall_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_AnotherCall_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_AnotherCall_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_AnotherCall_Result) FromWire(w wire.Value) error { var err error @@ -1793,14 +1793,14 @@ type SimpleService_Call_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -1845,16 +1845,16 @@ func (v *SimpleService_Call_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Args) FromWire(w wire.Value) error { var err error @@ -2247,14 +2247,14 @@ type SimpleService_Call_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2286,16 +2286,16 @@ func (v *SimpleService_Call_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Call_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Call_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Call_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Call_Result) FromWire(w wire.Value) error { var err error @@ -2501,14 +2501,14 @@ type SimpleService_Compare_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2546,16 +2546,16 @@ func (v *SimpleService_Compare_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Compare_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Args) FromWire(w wire.Value) error { var err error @@ -2902,14 +2902,14 @@ type SimpleService_Compare_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Compare_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2955,16 +2955,16 @@ func _BazResponse_Read(w wire.Value) (*BazResponse, error) { // An error is returned if we were unable to build a SimpleService_Compare_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Compare_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Compare_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Compare_Result) FromWire(w wire.Value) error { var err error @@ -3235,14 +3235,14 @@ type SimpleService_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3268,16 +3268,16 @@ func (v *SimpleService_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Echo_Args) FromWire(w wire.Value) error { var err error @@ -3541,14 +3541,14 @@ type SimpleService_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3580,16 +3580,16 @@ func (v *SimpleService_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Echo_Result) FromWire(w wire.Value) error { var err error @@ -3807,14 +3807,14 @@ type SimpleService_Ping_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -3831,16 +3831,16 @@ func (v *SimpleService_Ping_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4046,14 +4046,14 @@ type SimpleService_Ping_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4085,16 +4085,16 @@ func (v *SimpleService_Ping_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_Ping_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_Ping_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_Ping_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_Ping_Result) FromWire(w wire.Value) error { var err error @@ -4298,14 +4298,14 @@ type SimpleService_SillyNoop_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -4322,16 +4322,16 @@ func (v *SimpleService_SillyNoop_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -4554,14 +4554,14 @@ type SimpleService_SillyNoop_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_SillyNoop_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4607,16 +4607,16 @@ func _ServerErr_Read(w wire.Value) (*ServerErr, error) { // An error is returned if we were unable to build a SimpleService_SillyNoop_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_SillyNoop_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_SillyNoop_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_SillyNoop_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go index ef55415d0..25f07523a 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/echo/echo/echo.go @@ -27,14 +27,14 @@ type Echo_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Echo_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go index 2e2a734a4..ebc47b003 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux/quux.go @@ -27,14 +27,14 @@ type SimpleService_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *SimpleService_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type SimpleService_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *SimpleService_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *SimpleService_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a SimpleService_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v SimpleService_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v SimpleService_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *SimpleService_EchoString_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go index e660a22bb..22430fa22 100644 --- a/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/withexceptions/withexceptions/withexceptions.go @@ -25,14 +25,14 @@ type EndpointExceptionType1 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *EndpointExceptionType1) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -58,16 +58,16 @@ func (v *EndpointExceptionType1) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a EndpointExceptionType1 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v EndpointExceptionType1 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v EndpointExceptionType1 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *EndpointExceptionType1) FromWire(w wire.Value) error { var err error @@ -239,14 +239,14 @@ type EndpointExceptionType2 struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *EndpointExceptionType2) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -272,16 +272,16 @@ func (v *EndpointExceptionType2) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a EndpointExceptionType2 struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v EndpointExceptionType2 -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v EndpointExceptionType2 +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *EndpointExceptionType2) FromWire(w wire.Value) error { var err error @@ -452,14 +452,14 @@ type Response struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Response) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -476,16 +476,16 @@ func (v *Response) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Response struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Response -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Response +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Response) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -597,14 +597,14 @@ type WithExceptions_Func1_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -621,16 +621,16 @@ func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a WithExceptions_Func1_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -863,14 +863,14 @@ type WithExceptions_Func1_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -936,16 +936,16 @@ func _EndpointExceptionType2_Read(w wire.Value) (*EndpointExceptionType2, error) // An error is returned if we were unable to build a WithExceptions_Func1_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v WithExceptions_Func1_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v WithExceptions_Func1_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go b/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go index 4fff33491..58e436a48 100644 --- a/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go +++ b/examples/selective-gateway/build/gen-code/clients/bar/bar/bar.go @@ -31,14 +31,14 @@ type BarException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } +// +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -64,16 +64,16 @@ func (v *BarException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a BarException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarException) FromWire(w wire.Value) error { var err error @@ -250,14 +250,14 @@ type BarRequest struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequest) ToWire() (wire.Value, error) { var ( fields [6]wire.Field @@ -338,16 +338,16 @@ func _Long_Read(w wire.Value) (Long, error) { // An error is returned if we were unable to build a BarRequest struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequest -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequest +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequest) FromWire(w wire.Value) error { var err error @@ -781,14 +781,14 @@ type BarRequestRecur struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarRequestRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -828,16 +828,16 @@ func _BarRequestRecur_Read(w wire.Value) (*BarRequestRecur, error) { // An error is returned if we were unable to build a BarRequestRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarRequestRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarRequestRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarRequestRecur) FromWire(w wire.Value) error { var err error @@ -1132,14 +1132,14 @@ func (_Map_String_I32_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponse) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -1282,16 +1282,16 @@ func _BarResponse_Read(w wire.Value) (*BarResponse, error) { // An error is returned if we were unable to build a BarResponse struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponse -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponse +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponse) FromWire(w wire.Value) error { var err error @@ -1994,14 +1994,14 @@ func (_List_String_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *BarResponseRecur) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -2052,16 +2052,16 @@ func _List_String_Read(l wire.ValueList) ([]string, error) { // An error is returned if we were unable to build a BarResponseRecur struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v BarResponseRecur -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v BarResponseRecur +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *BarResponseRecur) FromWire(w wire.Value) error { var err error @@ -2358,8 +2358,8 @@ func DemoType_Values() []DemoType { // UnmarshalText tries to decode DemoType from a byte slice // containing its name. // -// var v DemoType -// err := v.UnmarshalText([]byte("FIRST")) +// var v DemoType +// err := v.UnmarshalText([]byte("FIRST")) func (v *DemoType) UnmarshalText(value []byte) error { switch s := string(value); s { case "FIRST": @@ -2416,10 +2416,10 @@ func (v DemoType) Ptr() *DemoType { // Encode encodes DemoType directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v DemoType -// return v.Encode(sWriter) +// var v DemoType +// return v.Encode(sWriter) func (v DemoType) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2436,16 +2436,16 @@ func (v DemoType) ToWire() (wire.Value, error) { // FromWire deserializes DemoType from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return DemoType(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return DemoType(0), err +// } // -// var v DemoType -// if err := v.FromWire(x); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.FromWire(x); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) FromWire(w wire.Value) error { *v = (DemoType)(w.GetI32()) return nil @@ -2453,13 +2453,13 @@ func (v *DemoType) FromWire(w wire.Value) error { // Decode reads off the encoded DemoType directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v DemoType -// if err := v.Decode(sReader); err != nil { -// return DemoType(0), err -// } -// return v, nil +// var v DemoType +// if err := v.Decode(sReader); err != nil { +// return DemoType(0), err +// } +// return v, nil func (v *DemoType) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2557,8 +2557,8 @@ func Fruit_Values() []Fruit { // UnmarshalText tries to decode Fruit from a byte slice // containing its name. // -// var v Fruit -// err := v.UnmarshalText([]byte("APPLE")) +// var v Fruit +// err := v.UnmarshalText([]byte("APPLE")) func (v *Fruit) UnmarshalText(value []byte) error { switch s := string(value); s { case "APPLE": @@ -2615,10 +2615,10 @@ func (v Fruit) Ptr() *Fruit { // Encode encodes Fruit directly to bytes. // -// sWriter := BinaryStreamer.Writer(writer) +// sWriter := BinaryStreamer.Writer(writer) // -// var v Fruit -// return v.Encode(sWriter) +// var v Fruit +// return v.Encode(sWriter) func (v Fruit) Encode(sw stream.Writer) error { return sw.WriteInt32(int32(v)) } @@ -2635,16 +2635,16 @@ func (v Fruit) ToWire() (wire.Value, error) { // FromWire deserializes Fruit from its Thrift-level // representation. // -// x, err := binaryProtocol.Decode(reader, wire.TI32) -// if err != nil { -// return Fruit(0), err -// } +// x, err := binaryProtocol.Decode(reader, wire.TI32) +// if err != nil { +// return Fruit(0), err +// } // -// var v Fruit -// if err := v.FromWire(x); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.FromWire(x); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) FromWire(w wire.Value) error { *v = (Fruit)(w.GetI32()) return nil @@ -2652,13 +2652,13 @@ func (v *Fruit) FromWire(w wire.Value) error { // Decode reads off the encoded Fruit directly off of the wire. // -// sReader := BinaryStreamer.Reader(reader) +// sReader := BinaryStreamer.Reader(reader) // -// var v Fruit -// if err := v.Decode(sReader); err != nil { -// return Fruit(0), err -// } -// return v, nil +// var v Fruit +// if err := v.Decode(sReader); err != nil { +// return Fruit(0), err +// } +// return v, nil func (v *Fruit) Decode(sr stream.Reader) error { i, err := sr.ReadInt32() if err != nil { @@ -2797,14 +2797,14 @@ type OptionalParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -2832,16 +2832,16 @@ func (v *OptionalParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a OptionalParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v OptionalParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v OptionalParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *OptionalParamsStruct) FromWire(w wire.Value) error { var err error @@ -3017,14 +3017,14 @@ type ParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *ParamsStruct) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -3050,16 +3050,16 @@ func (v *ParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a ParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v ParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v ParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *ParamsStruct) FromWire(w wire.Value) error { var err error @@ -3224,14 +3224,14 @@ type QueryParamsOptsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -3281,16 +3281,16 @@ func (v *QueryParamsOptsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsOptsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsOptsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsOptsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsOptsStruct) FromWire(w wire.Value) error { var err error @@ -3621,14 +3621,14 @@ type QueryParamsStruct struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *QueryParamsStruct) ToWire() (wire.Value, error) { var ( fields [5]wire.Field @@ -3685,16 +3685,16 @@ func (v *QueryParamsStruct) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a QueryParamsStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v QueryParamsStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v QueryParamsStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *QueryParamsStruct) FromWire(w wire.Value) error { var err error @@ -4078,14 +4078,14 @@ type RequestWithDuplicateType struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *RequestWithDuplicateType) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -4127,16 +4127,16 @@ func _BarRequest_Read(w wire.Value) (*BarRequest, error) { // An error is returned if we were unable to build a RequestWithDuplicateType struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v RequestWithDuplicateType -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v RequestWithDuplicateType +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *RequestWithDuplicateType) FromWire(w wire.Value) error { var err error @@ -4666,14 +4666,14 @@ type Bar_ArgNotStruct_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -4699,16 +4699,16 @@ func (v *Bar_ArgNotStruct_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Args) FromWire(w wire.Value) error { var err error @@ -4977,14 +4977,14 @@ type Bar_ArgNotStruct_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgNotStruct_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5022,16 +5022,16 @@ func _BarException_Read(w wire.Value) (*BarException, error) { // An error is returned if we were unable to build a Bar_ArgNotStruct_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgNotStruct_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgNotStruct_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgNotStruct_Result) FromWire(w wire.Value) error { var err error @@ -5244,14 +5244,14 @@ type Bar_ArgWithHeaders_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -5299,16 +5299,16 @@ func _OptionalParamsStruct_Read(w wire.Value) (*OptionalParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Args) FromWire(w wire.Value) error { var err error @@ -5690,14 +5690,14 @@ type Bar_ArgWithHeaders_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -5729,16 +5729,16 @@ func (v *Bar_ArgWithHeaders_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithHeaders_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithHeaders_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithHeaders_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithHeaders_Result) FromWire(w wire.Value) error { var err error @@ -6022,14 +6022,14 @@ func (_List_DemoType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [28]wire.Field @@ -6312,16 +6312,16 @@ func _List_DemoType_Read(l wire.ValueList) ([]DemoType, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -8359,14 +8359,14 @@ type Bar_ArgWithManyQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -8398,16 +8398,16 @@ func (v *Bar_ArgWithManyQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithManyQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithManyQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithManyQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithManyQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -8615,14 +8615,14 @@ type Bar_ArgWithNearDupQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -8672,16 +8672,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9119,14 +9119,14 @@ type Bar_ArgWithNearDupQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9158,16 +9158,16 @@ func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNearDupQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNearDupQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -9373,14 +9373,14 @@ type Bar_ArgWithNestedQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -9429,16 +9429,16 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -9776,14 +9776,14 @@ type Bar_ArgWithNestedQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -9815,16 +9815,16 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithNestedQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithNestedQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -10030,14 +10030,14 @@ type Bar_ArgWithParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10077,16 +10077,16 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error @@ -10410,14 +10410,14 @@ type Bar_ArgWithParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -10449,16 +10449,16 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error @@ -10664,14 +10664,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -10713,16 +10713,16 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error @@ -11052,14 +11052,14 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11091,16 +11091,16 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithParamsAndDuplicateFields_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error @@ -11305,14 +11305,14 @@ type Bar_ArgWithQueryHeader_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11340,16 +11340,16 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error @@ -11617,14 +11617,14 @@ type Bar_ArgWithQueryHeader_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -11656,16 +11656,16 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryHeader_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryHeader_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error @@ -11899,14 +11899,14 @@ func (_List_Byte_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [4]wire.Field @@ -11973,16 +11973,16 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -12491,14 +12491,14 @@ type Bar_ArgWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12530,16 +12530,16 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ArgWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ArgWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error @@ -12744,14 +12744,14 @@ type Bar_DeleteFoo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -12777,16 +12777,16 @@ func (v *Bar_DeleteFoo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Args) FromWire(w wire.Value) error { var err error @@ -13040,14 +13040,14 @@ type Bar_DeleteFoo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13064,16 +13064,16 @@ func (v *Bar_DeleteFoo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteFoo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteFoo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteFoo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteFoo_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13202,14 +13202,14 @@ type Bar_DeleteWithQueryParams_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -13243,16 +13243,16 @@ func (v *Bar_DeleteWithQueryParams_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Args) FromWire(w wire.Value) error { var err error @@ -13564,14 +13564,14 @@ type Bar_DeleteWithQueryParams_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13588,16 +13588,16 @@ func (v *Bar_DeleteWithQueryParams_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_DeleteWithQueryParams_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_DeleteWithQueryParams_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_DeleteWithQueryParams_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_DeleteWithQueryParams_Result) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13724,14 +13724,14 @@ type Bar_HelloWorld_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -13748,16 +13748,16 @@ func (v *Bar_HelloWorld_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -13978,14 +13978,14 @@ type Bar_HelloWorld_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14025,16 +14025,16 @@ func (v *Bar_HelloWorld_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_HelloWorld_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_HelloWorld_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_HelloWorld_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_HelloWorld_Result) FromWire(w wire.Value) error { var err error @@ -14305,14 +14305,14 @@ type Bar_ListAndEnum_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -14354,16 +14354,16 @@ func (v *Bar_ListAndEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Args) FromWire(w wire.Value) error { var err error @@ -14769,14 +14769,14 @@ type Bar_ListAndEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -14816,16 +14816,16 @@ func (v *Bar_ListAndEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_ListAndEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_ListAndEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_ListAndEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_ListAndEnum_Result) FromWire(w wire.Value) error { var err error @@ -15093,14 +15093,14 @@ type Bar_MissingArg_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15117,16 +15117,16 @@ func (v *Bar_MissingArg_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15347,14 +15347,14 @@ type Bar_MissingArg_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15394,16 +15394,16 @@ func (v *Bar_MissingArg_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_MissingArg_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_MissingArg_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_MissingArg_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_MissingArg_Result) FromWire(w wire.Value) error { var err error @@ -15667,14 +15667,14 @@ type Bar_NoRequest_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { var ( fields [0]wire.Field @@ -15691,16 +15691,16 @@ func (v *Bar_NoRequest_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Args) FromWire(w wire.Value) error { for _, field := range w.GetStruct().Fields { @@ -15921,14 +15921,14 @@ type Bar_NoRequest_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -15968,16 +15968,16 @@ func (v *Bar_NoRequest_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NoRequest_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NoRequest_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NoRequest_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NoRequest_Result) FromWire(w wire.Value) error { var err error @@ -16242,14 +16242,14 @@ type Bar_Normal_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16278,16 +16278,16 @@ func (v *Bar_Normal_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Args) FromWire(w wire.Value) error { var err error @@ -16574,14 +16574,14 @@ type Bar_Normal_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -16621,16 +16621,16 @@ func (v *Bar_Normal_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_Normal_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_Normal_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_Normal_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_Normal_Result) FromWire(w wire.Value) error { var err error @@ -16895,14 +16895,14 @@ type Bar_NormalRecur_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -16931,16 +16931,16 @@ func (v *Bar_NormalRecur_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Args) FromWire(w wire.Value) error { var err error @@ -17227,14 +17227,14 @@ type Bar_NormalRecur_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_NormalRecur_Result) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17280,16 +17280,16 @@ func _BarResponseRecur_Read(w wire.Value) (*BarResponseRecur, error) { // An error is returned if we were unable to build a Bar_NormalRecur_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_NormalRecur_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_NormalRecur_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_NormalRecur_Result) FromWire(w wire.Value) error { var err error @@ -17561,14 +17561,14 @@ type Bar_TooManyArgs_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field @@ -17611,16 +17611,16 @@ func _FooStruct_Read(w wire.Value) (*foo.FooStruct, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Args) FromWire(w wire.Value) error { var err error @@ -17979,14 +17979,14 @@ type Bar_TooManyArgs_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bar_TooManyArgs_Result) ToWire() (wire.Value, error) { var ( fields [3]wire.Field @@ -18040,16 +18040,16 @@ func _FooException_Read(w wire.Value) (*foo.FooException, error) { // An error is returned if we were unable to build a Bar_TooManyArgs_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bar_TooManyArgs_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bar_TooManyArgs_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bar_TooManyArgs_Result) FromWire(w wire.Value) error { var err error @@ -18380,14 +18380,14 @@ type Echo_EchoBinary_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18416,16 +18416,16 @@ func (v *Echo_EchoBinary_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Args) FromWire(w wire.Value) error { var err error @@ -18697,14 +18697,14 @@ type Echo_EchoBinary_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18736,16 +18736,16 @@ func (v *Echo_EchoBinary_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBinary_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBinary_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBinary_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBinary_Result) FromWire(w wire.Value) error { var err error @@ -18950,14 +18950,14 @@ type Echo_EchoBool_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -18983,16 +18983,16 @@ func (v *Echo_EchoBool_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Args) FromWire(w wire.Value) error { var err error @@ -19256,14 +19256,14 @@ type Echo_EchoBool_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19295,16 +19295,16 @@ func (v *Echo_EchoBool_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoBool_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoBool_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoBool_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoBool_Result) FromWire(w wire.Value) error { var err error @@ -19513,14 +19513,14 @@ type Echo_EchoDouble_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19546,16 +19546,16 @@ func (v *Echo_EchoDouble_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Args) FromWire(w wire.Value) error { var err error @@ -19819,14 +19819,14 @@ type Echo_EchoDouble_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -19858,16 +19858,16 @@ func (v *Echo_EchoDouble_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoDouble_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoDouble_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoDouble_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoDouble_Result) FromWire(w wire.Value) error { var err error @@ -20088,14 +20088,14 @@ func Default_Echo_EchoEnum_Args() *Echo_EchoEnum_Args { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20127,16 +20127,16 @@ func (v *Echo_EchoEnum_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Args) FromWire(w wire.Value) error { var err error @@ -20416,14 +20416,14 @@ type Echo_EchoEnum_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20455,16 +20455,16 @@ func (v *Echo_EchoEnum_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoEnum_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoEnum_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoEnum_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoEnum_Result) FromWire(w wire.Value) error { var err error @@ -20673,14 +20673,14 @@ type Echo_EchoI16_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -20706,16 +20706,16 @@ func (v *Echo_EchoI16_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Args) FromWire(w wire.Value) error { var err error @@ -20979,14 +20979,14 @@ type Echo_EchoI16_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21018,16 +21018,16 @@ func (v *Echo_EchoI16_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI16_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI16_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI16_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI16_Result) FromWire(w wire.Value) error { var err error @@ -21236,14 +21236,14 @@ type Echo_EchoI32_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21269,16 +21269,16 @@ func (v *Echo_EchoI32_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Args) FromWire(w wire.Value) error { var err error @@ -21542,14 +21542,14 @@ type Echo_EchoI32_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21581,16 +21581,16 @@ func (v *Echo_EchoI32_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32_Result) FromWire(w wire.Value) error { var err error @@ -21837,14 +21837,14 @@ func (_Map_I32_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -21901,16 +21901,16 @@ func _Map_I32_BarResponse_Read(m wire.MapItemList) (map[int32]*BarResponse, erro // An error is returned if we were unable to build a Echo_EchoI32Map_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Args) FromWire(w wire.Value) error { var err error @@ -22289,14 +22289,14 @@ type Echo_EchoI32Map_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22328,16 +22328,16 @@ func (v *Echo_EchoI32Map_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI32Map_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI32Map_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI32Map_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI32Map_Result) FromWire(w wire.Value) error { var err error @@ -22542,14 +22542,14 @@ type Echo_EchoI64_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22575,16 +22575,16 @@ func (v *Echo_EchoI64_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Args) FromWire(w wire.Value) error { var err error @@ -22848,14 +22848,14 @@ type Echo_EchoI64_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -22887,16 +22887,16 @@ func (v *Echo_EchoI64_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI64_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI64_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI64_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI64_Result) FromWire(w wire.Value) error { var err error @@ -23105,14 +23105,14 @@ type Echo_EchoI8_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23138,16 +23138,16 @@ func (v *Echo_EchoI8_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Args) FromWire(w wire.Value) error { var err error @@ -23411,14 +23411,14 @@ type Echo_EchoI8_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23450,16 +23450,16 @@ func (v *Echo_EchoI8_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoI8_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoI8_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoI8_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoI8_Result) FromWire(w wire.Value) error { var err error @@ -23668,14 +23668,14 @@ type Echo_EchoString_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -23701,16 +23701,16 @@ func (v *Echo_EchoString_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Args) FromWire(w wire.Value) error { var err error @@ -23974,14 +23974,14 @@ type Echo_EchoString_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24013,16 +24013,16 @@ func (v *Echo_EchoString_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoString_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoString_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoString_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoString_Result) FromWire(w wire.Value) error { var err error @@ -24231,14 +24231,14 @@ type Echo_EchoStringList_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24264,16 +24264,16 @@ func (v *Echo_EchoStringList_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Args) FromWire(w wire.Value) error { var err error @@ -24542,14 +24542,14 @@ type Echo_EchoStringList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24581,16 +24581,16 @@ func (v *Echo_EchoStringList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringList_Result) FromWire(w wire.Value) error { var err error @@ -24833,14 +24833,14 @@ func (_Map_String_BarResponse_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -24897,16 +24897,16 @@ func _Map_String_BarResponse_Read(m wire.MapItemList) (map[string]*BarResponse, // An error is returned if we were unable to build a Echo_EchoStringMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Args) FromWire(w wire.Value) error { var err error @@ -25272,14 +25272,14 @@ type Echo_EchoStringMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25311,16 +25311,16 @@ func (v *Echo_EchoStringMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringMap_Result) FromWire(w wire.Value) error { var err error @@ -25551,14 +25551,14 @@ func (_Set_String_mapType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -25606,16 +25606,16 @@ func _Set_String_mapType_Read(s wire.ValueList) (map[string]struct{}, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Args) FromWire(w wire.Value) error { var err error @@ -25963,14 +25963,14 @@ type Echo_EchoStringSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26002,16 +26002,16 @@ func (v *Echo_EchoStringSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStringSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStringSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStringSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStringSet_Result) FromWire(w wire.Value) error { var err error @@ -26245,14 +26245,14 @@ func (_List_BarResponse_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26296,16 +26296,16 @@ func _List_BarResponse_Read(l wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Args) FromWire(w wire.Value) error { var err error @@ -26651,14 +26651,14 @@ type Echo_EchoStructList_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -26690,16 +26690,16 @@ func (v *Echo_EchoStructList_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructList_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructList_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructList_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructList_Result) FromWire(w wire.Value) error { var err error @@ -26950,14 +26950,14 @@ func (_Map_BarResponse_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27023,16 +27023,16 @@ func _Map_BarResponse_String_Read(m wire.MapItemList) ([]struct { // An error is returned if we were unable to build a Echo_EchoStructMap_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Args) FromWire(w wire.Value) error { var err error @@ -27469,14 +27469,14 @@ type Echo_EchoStructMap_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27508,16 +27508,16 @@ func (v *Echo_EchoStructMap_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructMap_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructMap_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructMap_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructMap_Result) FromWire(w wire.Value) error { var err error @@ -27754,14 +27754,14 @@ func (_Set_BarResponse_sliceType_ValueList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -27809,16 +27809,16 @@ func _Set_BarResponse_sliceType_Read(s wire.ValueList) ([]*BarResponse, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Args) FromWire(w wire.Value) error { var err error @@ -28176,14 +28176,14 @@ type Echo_EchoStructSet_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28215,16 +28215,16 @@ func (v *Echo_EchoStructSet_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoStructSet_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoStructSet_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoStructSet_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoStructSet_Result) FromWire(w wire.Value) error { var err error @@ -28429,14 +28429,14 @@ type Echo_EchoTypedef_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28462,16 +28462,16 @@ func (v *Echo_EchoTypedef_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Args) FromWire(w wire.Value) error { var err error @@ -28735,14 +28735,14 @@ type Echo_EchoTypedef_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -28774,16 +28774,16 @@ func (v *Echo_EchoTypedef_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_EchoTypedef_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_EchoTypedef_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_EchoTypedef_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_EchoTypedef_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go b/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go index 6a6319ad1..b53de2e66 100644 --- a/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go +++ b/examples/selective-gateway/build/gen-code/clients/foo/base/base/base.go @@ -24,14 +24,14 @@ type Message struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Message) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -57,16 +57,16 @@ func (v *Message) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Message struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Message -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Message +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Message) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go b/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go index 94b7ce514..6136ddb2d 100644 --- a/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go +++ b/examples/selective-gateway/build/gen-code/clients/foo/foo/foo.go @@ -26,14 +26,14 @@ type FooException struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooException) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -59,16 +59,16 @@ func (v *FooException) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooException struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooException -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooException +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooException) FromWire(w wire.Value) error { var err error @@ -240,14 +240,14 @@ type FooName struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooName) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -275,16 +275,16 @@ func (v *FooName) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a FooName struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooName -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooName +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooName) FromWire(w wire.Value) error { var err error @@ -501,14 +501,14 @@ func (_Map_String_String_MapItemList) Close() {} // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *FooStruct) ToWire() (wire.Value, error) { var ( fields [7]wire.Field @@ -616,16 +616,16 @@ func _Message_Read(w wire.Value) (*base.Message, error) { // An error is returned if we were unable to build a FooStruct struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v FooStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v FooStruct +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *FooStruct) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go b/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go index 2196bf6a4..109ea1040 100644 --- a/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go +++ b/examples/selective-gateway/build/gen-code/endpoints/bounce/bounce/bounce.go @@ -27,14 +27,14 @@ type Bounce_Bounce_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Bounce_Bounce_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Bounce_Bounce_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Bounce_Bounce_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Bounce_Bounce_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Bounce_Bounce_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Bounce_Bounce_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Bounce_Bounce_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go b/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go index ef55415d0..25f07523a 100644 --- a/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go +++ b/examples/selective-gateway/build/gen-code/endpoints/tchannel/echo/echo/echo.go @@ -27,14 +27,14 @@ type Echo_Echo_Args struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -60,16 +60,16 @@ func (v *Echo_Echo_Args) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Args struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Args -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Args +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Args) FromWire(w wire.Value) error { var err error @@ -333,14 +333,14 @@ type Echo_Echo_Result struct { // An error is returned if the struct or any of its fields failed to // validate. // -// x, err := v.ToWire() -// if err != nil { -// return err -// } +// x, err := v.ToWire() +// if err != nil { +// return err +// } // -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } +// if err := binaryProtocol.Encode(x, writer); err != nil { +// return err +// } func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field @@ -372,16 +372,16 @@ func (v *Echo_Echo_Result) ToWire() (wire.Value, error) { // An error is returned if we were unable to build a Echo_Echo_Result struct // from the provided intermediate representation. // -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } +// x, err := binaryProtocol.Decode(reader, wire.TStruct) +// if err != nil { +// return nil, err +// } // -// var v Echo_Echo_Result -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil +// var v Echo_Echo_Result +// if err := v.FromWire(x); err != nil { +// return nil, err +// } +// return &v, nil func (v *Echo_Echo_Result) FromWire(w wire.Value) error { var err error diff --git a/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go b/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go index 7a5e6f298..8b2da3861 100644 --- a/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go +++ b/examples/selective-gateway/build/proto-gen/clients/echo/echo.pb.yarpc.go @@ -107,10 +107,10 @@ type FxEchoYARPCClientResult struct { // NewFxEchoYARPCClient provides a EchoYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCClient("service-name"), +// ... +// ) func NewFxEchoYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoYARPCClientParams) FxEchoYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxEchoYARPCProceduresResult struct { // NewFxEchoYARPCProcedures provides EchoYARPCServer procedures to an Fx application. // It expects a EchoYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoYARPCProcedures(), +// ... +// ) func NewFxEchoYARPCProcedures() interface{} { return func(params FxEchoYARPCProceduresParams) FxEchoYARPCProceduresResult { return FxEchoYARPCProceduresResult{ @@ -311,10 +311,10 @@ type FxEchoInternalYARPCClientResult struct { // NewFxEchoInternalYARPCClient provides a EchoInternalYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// echo.NewFxEchoInternalYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoInternalYARPCClient("service-name"), +// ... +// ) func NewFxEchoInternalYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxEchoInternalYARPCClientParams) FxEchoInternalYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -360,10 +360,10 @@ type FxEchoInternalYARPCProceduresResult struct { // NewFxEchoInternalYARPCProcedures provides EchoInternalYARPCServer procedures to an Fx application. // It expects a EchoInternalYARPCServer to be present in the container. // -// fx.Provide( -// echo.NewFxEchoInternalYARPCProcedures(), -// ... -// ) +// fx.Provide( +// echo.NewFxEchoInternalYARPCProcedures(), +// ... +// ) func NewFxEchoInternalYARPCProcedures() interface{} { return func(params FxEchoInternalYARPCProceduresParams) FxEchoInternalYARPCProceduresResult { return FxEchoInternalYARPCProceduresResult{ diff --git a/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go b/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go index cee0d9f40..20f065baa 100644 --- a/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go +++ b/examples/selective-gateway/build/proto-gen/clients/mirror/mirror.pb.yarpc.go @@ -107,10 +107,10 @@ type FxMirrorYARPCClientResult struct { // NewFxMirrorYARPCClient provides a MirrorYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// mirror.NewFxMirrorYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorYARPCClient("service-name"), +// ... +// ) func NewFxMirrorYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxMirrorYARPCClientParams) FxMirrorYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -156,10 +156,10 @@ type FxMirrorYARPCProceduresResult struct { // NewFxMirrorYARPCProcedures provides MirrorYARPCServer procedures to an Fx application. // It expects a MirrorYARPCServer to be present in the container. // -// fx.Provide( -// mirror.NewFxMirrorYARPCProcedures(), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorYARPCProcedures(), +// ... +// ) func NewFxMirrorYARPCProcedures() interface{} { return func(params FxMirrorYARPCProceduresParams) FxMirrorYARPCProceduresResult { return FxMirrorYARPCProceduresResult{ @@ -311,10 +311,10 @@ type FxMirrorInternalYARPCClientResult struct { // NewFxMirrorInternalYARPCClient provides a MirrorInternalYARPCClient // to an Fx application using the given name for routing. // -// fx.Provide( -// mirror.NewFxMirrorInternalYARPCClient("service-name"), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorInternalYARPCClient("service-name"), +// ... +// ) func NewFxMirrorInternalYARPCClient(name string, options ...protobuf.ClientOption) interface{} { return func(params FxMirrorInternalYARPCClientParams) FxMirrorInternalYARPCClientResult { cc := params.Provider.ClientConfig(name) @@ -360,10 +360,10 @@ type FxMirrorInternalYARPCProceduresResult struct { // NewFxMirrorInternalYARPCProcedures provides MirrorInternalYARPCServer procedures to an Fx application. // It expects a MirrorInternalYARPCServer to be present in the container. // -// fx.Provide( -// mirror.NewFxMirrorInternalYARPCProcedures(), -// ... -// ) +// fx.Provide( +// mirror.NewFxMirrorInternalYARPCProcedures(), +// ... +// ) func NewFxMirrorInternalYARPCProcedures() interface{} { return func(params FxMirrorInternalYARPCProceduresParams) FxMirrorInternalYARPCProceduresResult { return FxMirrorInternalYARPCProceduresResult{ From 2435514d54a313764a6873618237049c06d61f85 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Wed, 28 Jun 2023 10:27:00 +0000 Subject: [PATCH 18/86] remove trailing whitespaces --- codegen/template_bundle/template_files.go | 14 +++++++------- codegen/templates/endpoint.tmpl | 2 +- codegen/templates/workflow.tmpl | 8 ++++---- .../endpoints/bar/bar_bar_method_argwithheaders.go | 1 - .../bar/bar_bar_method_argwithmanyqueryparams.go | 1 - .../bar_bar_method_argwithneardupqueryparams.go | 1 - .../bar/bar_bar_method_argwithnestedqueryparams.go | 1 - .../endpoints/bar/bar_bar_method_argwithparams.go | 1 - ...r_bar_method_argwithparamsandduplicatefields.go | 1 - .../bar/bar_bar_method_argwithqueryheader.go | 1 - .../bar/bar_bar_method_argwithqueryparams.go | 1 - .../endpoints/bar/bar_bar_method_deletewithbody.go | 1 - .../bar/workflow/bar_bar_method_argnotstruct.go | 2 -- .../bar/workflow/bar_bar_method_argwithheaders.go | 2 -- .../bar_bar_method_argwithmanyqueryparams.go | 2 -- .../bar_bar_method_argwithneardupqueryparams.go | 2 -- .../bar_bar_method_argwithnestedqueryparams.go | 2 -- .../bar/workflow/bar_bar_method_argwithparams.go | 2 -- ...r_bar_method_argwithparamsandduplicatefields.go | 2 -- .../workflow/bar_bar_method_argwithqueryheader.go | 2 -- .../workflow/bar_bar_method_argwithqueryparams.go | 2 -- .../bar/workflow/bar_bar_method_deletewithbody.go | 2 -- .../bar/workflow/bar_bar_method_helloworld.go | 2 -- .../bar/workflow/bar_bar_method_listandenum.go | 2 -- .../bar/workflow/bar_bar_method_missingarg.go | 2 -- .../bar/workflow/bar_bar_method_norequest.go | 2 -- .../bar/workflow/bar_bar_method_normal.go | 2 -- .../bar/workflow/bar_bar_method_toomanyargs.go | 2 -- .../endpoints/baz/baz_simpleservice_method_ping.go | 1 - .../baz/workflow/baz_simpleservice_method_call.go | 2 -- .../workflow/baz_simpleservice_method_compare.go | 2 -- .../baz_simpleservice_method_getprofile.go | 2 -- .../baz_simpleservice_method_headerschema.go | 2 -- .../baz/workflow/baz_simpleservice_method_ping.go | 2 -- .../workflow/baz_simpleservice_method_sillynoop.go | 2 -- .../baz/workflow/baz_simpleservice_method_trans.go | 2 -- .../baz_simpleservice_method_transheaders.go | 2 -- .../baz_simpleservice_method_transheadersnoreq.go | 2 -- .../baz_simpleservice_method_transheaderstype.go | 2 -- .../clientless_clientless_method_beta.go | 1 - ...s_clientless_method_clientlessargwithheaders.go | 1 - ...ess_clientless_method_emptyclientlessrequest.go | 1 - .../googlenow_googlenow_method_addcredentials.go | 1 - .../googlenow_googlenow_method_checkcredentials.go | 1 - .../googlenow_googlenow_method_addcredentials.go | 2 -- .../googlenow_googlenow_method_checkcredentials.go | 2 -- .../multi/multi_serviceafront_method_hello.go | 1 - .../multi/multi_servicebfront_method_hello.go | 1 - .../workflow/multi_serviceafront_method_hello.go | 2 -- .../workflow/multi_servicebfront_method_hello.go | 2 -- .../panic/panic_servicecfront_method_hello.go | 1 - .../withexceptions_withexceptions_method_func1.go | 2 -- 52 files changed, 12 insertions(+), 92 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index f085c375f..d85e7c5ec 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -644,7 +644,7 @@ func (h *{{$handlerName}}) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - {{if eq (len .Exceptions) 0}} + {{if eq (len .Exceptions) 0 -}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} @@ -705,7 +705,7 @@ func endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "endpoint.tmpl", size: 8030, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "endpoint.tmpl", size: 8032, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4665,13 +4665,13 @@ func (w {{$workflowStruct}}) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - {{if eq $responseType ""}} + {{if eq $responseType "" -}} return ctx, nil, err - {{else if eq $responseType "string" }} + {{else if eq $responseType "string" -}} return ctx, "", nil, err - {{else}} + {{else -}} return ctx, nil, nil, err - {{end}} + {{- end -}} } // Filter and map response headers from client to server response. @@ -4746,7 +4746,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10619, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10628, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/codegen/templates/endpoint.tmpl b/codegen/templates/endpoint.tmpl index aaa7f97fa..e5bd1a20b 100644 --- a/codegen/templates/endpoint.tmpl +++ b/codegen/templates/endpoint.tmpl @@ -220,7 +220,7 @@ func (h *{{$handlerName}}) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - {{if eq (len .Exceptions) 0}} + {{if eq (len .Exceptions) 0 -}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} diff --git a/codegen/templates/workflow.tmpl b/codegen/templates/workflow.tmpl index f11337c90..3b68fa556 100644 --- a/codegen/templates/workflow.tmpl +++ b/codegen/templates/workflow.tmpl @@ -248,13 +248,13 @@ func (w {{$workflowStruct}}) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - {{if eq $responseType ""}} + {{if eq $responseType "" -}} return ctx, nil, err - {{else if eq $responseType "string" }} + {{else if eq $responseType "string" -}} return ctx, "", nil, err - {{else}} + {{else -}} return ctx, nil, nil, err - {{end}} + {{- end -}} } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go index dd1cc0868..be53604e8 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go @@ -176,7 +176,6 @@ func (h *BarArgWithHeadersHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go index eb98461a2..bd7010235 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go @@ -479,7 +479,6 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go index e0d99324d..659197ee7 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go @@ -202,7 +202,6 @@ func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go index fac805b6d..afd35f2c2 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go @@ -258,7 +258,6 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go index bba729ca8..be5d09bb9 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go @@ -173,7 +173,6 @@ func (h *BarArgWithParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go index c0aacea40..9b59292f6 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go @@ -169,7 +169,6 @@ func (h *BarArgWithParamsAndDuplicateFieldsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go index cc14126f1..8bdb04f8f 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go @@ -170,7 +170,6 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go index 7508f0b51..631aa1217 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go @@ -203,7 +203,6 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go index 8e4daed0d..bd2c46e31 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go @@ -145,7 +145,6 @@ func (h *BarDeleteWithBodyHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go index ad30f2855..bee111ad9 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go @@ -150,9 +150,7 @@ func (w barArgNotStructWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go index 6c493321f..537c72dc7 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go @@ -149,9 +149,7 @@ func (w barArgWithHeadersWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go index 80cc920b2..325caab49 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go @@ -145,9 +145,7 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go index 3cab5d5bc..7185b8821 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go @@ -145,9 +145,7 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go index 47ab83355..b8575cd14 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go @@ -145,9 +145,7 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go index 1918aa27c..572f151fd 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go @@ -145,9 +145,7 @@ func (w barArgWithParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go index 6e3692b68..f26488965 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go @@ -145,9 +145,7 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go index 938c91a0a..be8a16b67 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go @@ -145,9 +145,7 @@ func (w barArgWithQueryHeaderWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go index 1336eb278..2d7e95d61 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go @@ -153,9 +153,7 @@ func (w barArgWithQueryParamsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go index e7196ddd6..2e15182bc 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go @@ -145,9 +145,7 @@ func (w barDeleteWithBodyWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go index 8e05edc47..8c3f17a5c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go @@ -152,9 +152,7 @@ func (w barHelloWorldWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go index ea1bfd142..7c3ef3e5f 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go @@ -150,9 +150,7 @@ func (w barListAndEnumWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go index fda757258..618fb4d62 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go @@ -147,9 +147,7 @@ func (w barMissingArgWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go index b51c7d56e..eb87117a2 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go @@ -147,9 +147,7 @@ func (w barNoRequestWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go index ea1c01223..e4c806a8a 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go @@ -150,9 +150,7 @@ func (w barNormalWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go index 522a121a8..5446ae260 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go @@ -166,9 +166,7 @@ func (w barTooManyArgsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go index 410cf0d7d..455f961eb 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go @@ -137,7 +137,6 @@ func (h *SimpleServicePingHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go index 46669a571..f6c1915d0 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go @@ -158,9 +158,7 @@ func (w simpleServiceCallWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go index ba248ccb5..4b36d0958 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go @@ -156,9 +156,7 @@ func (w simpleServiceCompareWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go index cd701ce34..6f465247c 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go @@ -150,9 +150,7 @@ func (w simpleServiceGetProfileWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go index 610f9b36b..ad5f09127 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go @@ -171,9 +171,7 @@ func (w simpleServiceHeaderSchemaWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go index 1c02751e2..490796865 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go @@ -142,9 +142,7 @@ func (w simpleServicePingWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go index 105c5de4c..f632c62b1 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go @@ -151,9 +151,7 @@ func (w simpleServiceSillyNoopWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go index 5cc5b6d54..27585a7a5 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go @@ -156,9 +156,7 @@ func (w simpleServiceTransWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go index e3f915461..040ad7359 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go @@ -165,9 +165,7 @@ func (w simpleServiceTransHeadersWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go index d65fa83f3..17ab6df3e 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go @@ -162,9 +162,7 @@ func (w simpleServiceTransHeadersNoReqWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go index b7882354a..b2155b794 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go @@ -157,9 +157,7 @@ func (w simpleServiceTransHeadersTypeWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go index 728cb69b5..8ee668432 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go @@ -167,7 +167,6 @@ func (h *ClientlessBetaHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go index b832d5e80..10dd28de5 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go @@ -178,7 +178,6 @@ func (h *ClientlessClientlessArgWithHeadersHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go index fe8c447a9..f83e3d51e 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go @@ -152,7 +152,6 @@ func (h *ClientlessEmptyclientlessRequestHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go index 64c8d4e29..969ccc526 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go @@ -148,7 +148,6 @@ func (h *GoogleNowAddCredentialsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go index 08022c5e9..55efad4d1 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go @@ -141,7 +141,6 @@ func (h *GoogleNowCheckCredentialsHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go index c9c028780..9c3b63b10 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go @@ -153,9 +153,7 @@ func (w googleNowAddCredentialsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go index ec2916bec..a5a9755b2 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go @@ -145,9 +145,7 @@ func (w googleNowCheckCredentialsWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go index 8aa679135..9d632d4d3 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go @@ -138,7 +138,6 @@ func (h *ServiceAFrontHelloHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go index b54960d0c..c0e541e91 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go @@ -138,7 +138,6 @@ func (h *ServiceBFrontHelloHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go index 7f448f2d8..7181f6b70 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go @@ -139,9 +139,7 @@ func (w serviceAFrontHelloWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go index 03d854b07..eab3b6988 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go @@ -139,9 +139,7 @@ func (w serviceBFrontHelloWorkflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, "", nil, err - } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go index c0f36197f..4cd7be1e3 100644 --- a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go @@ -138,7 +138,6 @@ func (h *ServiceCFrontHelloHandler) HandleRequest( if zErr, ok := err.(zanzibar.Error); ok { err = zErr.Unwrap() } - res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go index 73fc3817d..1ae75de71 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go @@ -152,9 +152,7 @@ func (w withExceptionsFunc1Workflow) Handle( ) } err = w.errorBuilder.Rebuild(zErr, err) - return ctx, nil, nil, err - } // Filter and map response headers from client to server response. From af00a836a35206a124f4b64f03cb707759d17a58 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Thu, 29 Jun 2023 06:37:49 +0000 Subject: [PATCH 19/86] fix error building --- codegen/templates/workflow.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/codegen/templates/workflow.tmpl b/codegen/templates/workflow.tmpl index 3b68fa556..4b531efb0 100644 --- a/codegen/templates/workflow.tmpl +++ b/codegen/templates/workflow.tmpl @@ -247,7 +247,9 @@ func (w {{$workflowStruct}}) Handle( zap.String("client", "{{$clientName}}"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } {{if eq $responseType "" -}} return ctx, nil, err {{else if eq $responseType "string" -}} From d24773ed86d54bbdddf6a53606f42bc6be6a6404 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Thu, 29 Jun 2023 06:39:15 +0000 Subject: [PATCH 20/86] gen code --- codegen/template_bundle/template_files.go | 6 ++++-- .../endpoints/bar/workflow/bar_bar_method_argnotstruct.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_argwithheaders.go | 4 +++- .../bar/workflow/bar_bar_method_argwithmanyqueryparams.go | 4 +++- .../workflow/bar_bar_method_argwithneardupqueryparams.go | 4 +++- .../bar/workflow/bar_bar_method_argwithnestedqueryparams.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_argwithparams.go | 4 +++- .../bar_bar_method_argwithparamsandduplicatefields.go | 4 +++- .../bar/workflow/bar_bar_method_argwithqueryheader.go | 4 +++- .../bar/workflow/bar_bar_method_argwithqueryparams.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_deletewithbody.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_helloworld.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_listandenum.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_missingarg.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_norequest.go | 4 +++- .../build/endpoints/bar/workflow/bar_bar_method_normal.go | 4 +++- .../endpoints/bar/workflow/bar_bar_method_toomanyargs.go | 4 +++- .../endpoints/baz/workflow/baz_simpleservice_method_call.go | 4 +++- .../baz/workflow/baz_simpleservice_method_compare.go | 4 +++- .../baz/workflow/baz_simpleservice_method_getprofile.go | 4 +++- .../baz/workflow/baz_simpleservice_method_headerschema.go | 4 +++- .../endpoints/baz/workflow/baz_simpleservice_method_ping.go | 4 +++- .../baz/workflow/baz_simpleservice_method_sillynoop.go | 4 +++- .../baz/workflow/baz_simpleservice_method_trans.go | 4 +++- .../baz/workflow/baz_simpleservice_method_transheaders.go | 4 +++- .../workflow/baz_simpleservice_method_transheadersnoreq.go | 4 +++- .../workflow/baz_simpleservice_method_transheaderstype.go | 4 +++- .../workflow/googlenow_googlenow_method_addcredentials.go | 4 +++- .../workflow/googlenow_googlenow_method_checkcredentials.go | 4 +++- .../multi/workflow/multi_serviceafront_method_hello.go | 4 +++- .../multi/workflow/multi_servicebfront_method_hello.go | 4 +++- .../workflow/withexceptions_withexceptions_method_func1.go | 4 +++- 32 files changed, 97 insertions(+), 33 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index d85e7c5ec..d7495834d 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -4664,7 +4664,9 @@ func (w {{$workflowStruct}}) Handle( zap.String("client", "{{$clientName}}"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } {{if eq $responseType "" -}} return ctx, nil, err {{else if eq $responseType "string" -}} @@ -4746,7 +4748,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10628, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10652, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go index bee111ad9..7d1c11b3e 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go @@ -149,7 +149,9 @@ func (w barArgNotStructWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go index 537c72dc7..fd804e948 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go @@ -148,7 +148,9 @@ func (w barArgWithHeadersWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go index 325caab49..d52512390 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go @@ -144,7 +144,9 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go index 7185b8821..9c8cd4d22 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go @@ -144,7 +144,9 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go index b8575cd14..29297c079 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go @@ -144,7 +144,9 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go index 572f151fd..5cf5fa521 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go @@ -144,7 +144,9 @@ func (w barArgWithParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go index f26488965..ac2b4ea24 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go @@ -144,7 +144,9 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go index be8a16b67..5fdce11e9 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go @@ -144,7 +144,9 @@ func (w barArgWithQueryHeaderWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go index 2d7e95d61..64458618c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go @@ -152,7 +152,9 @@ func (w barArgWithQueryParamsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go index 2e15182bc..98e77ba16 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go @@ -144,7 +144,9 @@ func (w barDeleteWithBodyWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go index 8c3f17a5c..5ec0f4375 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go @@ -151,7 +151,9 @@ func (w barHelloWorldWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, "", nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go index 7c3ef3e5f..5eb596f91 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go @@ -149,7 +149,9 @@ func (w barListAndEnumWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, "", nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go index 618fb4d62..cd6c6a99d 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go @@ -146,7 +146,9 @@ func (w barMissingArgWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go index eb87117a2..ce5c95bdb 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go @@ -146,7 +146,9 @@ func (w barNoRequestWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go index e4c806a8a..570d90bc1 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go @@ -149,7 +149,9 @@ func (w barNormalWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go index 5446ae260..792870f9f 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go @@ -165,7 +165,9 @@ func (w barTooManyArgsWorkflow) Handle( zap.String("client", "Bar"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go index f6c1915d0..8d0bb0408 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go @@ -157,7 +157,9 @@ func (w simpleServiceCallWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go index 4b36d0958..db81c362e 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go @@ -155,7 +155,9 @@ func (w simpleServiceCompareWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go index 6f465247c..e86093e2c 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go @@ -149,7 +149,9 @@ func (w simpleServiceGetProfileWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go index ad5f09127..b758bb9fd 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go @@ -170,7 +170,9 @@ func (w simpleServiceHeaderSchemaWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go index 490796865..28c53a688 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go @@ -141,7 +141,9 @@ func (w simpleServicePingWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go index f632c62b1..3fdee6c8d 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go @@ -150,7 +150,9 @@ func (w simpleServiceSillyNoopWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go index 27585a7a5..454dda6a3 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go @@ -155,7 +155,9 @@ func (w simpleServiceTransWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go index 040ad7359..f4bc8336d 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go @@ -164,7 +164,9 @@ func (w simpleServiceTransHeadersWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go index 17ab6df3e..28d294aac 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go @@ -161,7 +161,9 @@ func (w simpleServiceTransHeadersNoReqWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go index b2155b794..e045d93d2 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go @@ -156,7 +156,9 @@ func (w simpleServiceTransHeadersTypeWorkflow) Handle( zap.String("client", "Baz"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go index 9c3b63b10..7ddcd7aea 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go @@ -152,7 +152,9 @@ func (w googleNowAddCredentialsWorkflow) Handle( zap.String("client", "GoogleNow"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go index a5a9755b2..15083188e 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go @@ -144,7 +144,9 @@ func (w googleNowCheckCredentialsWorkflow) Handle( zap.String("client", "GoogleNow"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, err } diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go index 7181f6b70..d116ffc54 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go @@ -138,7 +138,9 @@ func (w serviceAFrontHelloWorkflow) Handle( zap.String("client", "Multi"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, "", nil, err } diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go index eab3b6988..9de69b584 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go @@ -138,7 +138,9 @@ func (w serviceBFrontHelloWorkflow) Handle( zap.String("client", "Multi"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, "", nil, err } diff --git a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go index 1ae75de71..9fbaf6fa6 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go @@ -151,7 +151,9 @@ func (w withExceptionsFunc1Workflow) Handle( zap.String("client", "Withexceptions"), ) } - err = w.errorBuilder.Rebuild(zErr, err) + if zErr != nil { + err = w.errorBuilder.Rebuild(zErr, err) + } return ctx, nil, nil, err } From 4d9f37f8dfcbe78b37a6cbb85e579f72d205a39f Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Fri, 30 Jun 2023 07:27:23 +0000 Subject: [PATCH 21/86] codegen --- codegen/template_bundle/template_files.go | 8 ++--- config/production.gen.go | 35 ++++++++++++++----- .../clients/bar/mock-client/mock_client.go | 6 ++-- .../contacts/mock-client/mock_client.go | 6 ++-- .../corge-http/mock-client/mock_client.go | 6 ++-- .../custom-bar/mock-client/mock_client.go | 6 ++-- .../google-now/mock-client/mock_client.go | 6 ++-- .../clients/multi/mock-client/mock_client.go | 6 ++-- .../withexceptions/mock-client/mock_client.go | 6 ++-- 9 files changed, 51 insertions(+), 34 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index d7495834d..bea6108d2 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -2781,7 +2781,7 @@ func mainTmpl() (*asset, error) { return a, nil } -var _main_testTmpl = []byte(`{{- /* template to render gateway main_test.go +var _main_testTmpl = []byte(`{{- /* template to render gateway main_test.go This template is the test entrypoint for spawning a gateway as a child process using the test coverage features etc. */ -}} @@ -3995,7 +3995,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16278, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16115, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4410,7 +4410,7 @@ func tchannel_endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9370, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9430, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4748,7 +4748,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10652, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10526, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/config/production.gen.go b/config/production.gen.go index 2bc28cfcd..eab9bb889 100644 --- a/config/production.gen.go +++ b/config/production.gen.go @@ -1,3 +1,23 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + // Code generated by go-bindata. // sources: // config/production.yaml @@ -13,7 +33,6 @@ import ( "strings" "time" ) - type asset struct { bytes []byte info os.FileInfo @@ -146,13 +165,11 @@ var _bindata = map[string]func() (*asset, error){ // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: -// -// data/ -// foo.txt -// img/ -// a.png -// b.png -// +// data/ +// foo.txt +// img/ +// a.png +// b.png // then AssetDir("data") would return []string{"foo.txt", "img"} // AssetDir("data/img") would return []string{"a.png", "b.png"} // AssetDir("foo.txt") and AssetDir("notexist") would return an error @@ -183,7 +200,6 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } - var _bintree = &bintree{nil, map[string]*bintree{ "production.yaml": &bintree{productionYaml, map[string]*bintree{}}, }} @@ -234,3 +250,4 @@ func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } + diff --git a/examples/example-gateway/build/clients/bar/mock-client/mock_client.go b/examples/example-gateway/build/clients/bar/mock-client/mock_client.go index c62a3f6c6..e25e6a225 100644 --- a/examples/example-gateway/build/clients/bar/mock-client/mock_client.go +++ b/examples/example-gateway/build/clients/bar/mock-client/mock_client.go @@ -10,7 +10,7 @@ import ( gomock "github.com/golang/mock/gomock" bar "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar" - zanzibar "github.com/uber/zanzibar/runtime" + runtime "github.com/uber/zanzibar/runtime" ) // MockClient is a mock of Client interface. @@ -509,10 +509,10 @@ func (mr *MockClientMockRecorder) EchoTypedef(arg0, arg1, arg2 interface{}) *gom } // HTTPClient mocks base method. -func (m *MockClient) HTTPClient() *zanzibar.HTTPClient { +func (m *MockClient) HTTPClient() *runtime.HTTPClient { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HTTPClient") - ret0, _ := ret[0].(*zanzibar.HTTPClient) + ret0, _ := ret[0].(*runtime.HTTPClient) return ret0 } diff --git a/examples/example-gateway/build/clients/contacts/mock-client/mock_client.go b/examples/example-gateway/build/clients/contacts/mock-client/mock_client.go index 3cd501bf9..e36607e73 100644 --- a/examples/example-gateway/build/clients/contacts/mock-client/mock_client.go +++ b/examples/example-gateway/build/clients/contacts/mock-client/mock_client.go @@ -10,7 +10,7 @@ import ( gomock "github.com/golang/mock/gomock" contacts "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients-idl/clients/contacts/contacts" - zanzibar "github.com/uber/zanzibar/runtime" + runtime "github.com/uber/zanzibar/runtime" ) // MockClient is a mock of Client interface. @@ -37,10 +37,10 @@ func (m *MockClient) EXPECT() *MockClientMockRecorder { } // HTTPClient mocks base method. -func (m *MockClient) HTTPClient() *zanzibar.HTTPClient { +func (m *MockClient) HTTPClient() *runtime.HTTPClient { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HTTPClient") - ret0, _ := ret[0].(*zanzibar.HTTPClient) + ret0, _ := ret[0].(*runtime.HTTPClient) return ret0 } diff --git a/examples/example-gateway/build/clients/corge-http/mock-client/mock_client.go b/examples/example-gateway/build/clients/corge-http/mock-client/mock_client.go index e0214d48f..da7d8d9ab 100644 --- a/examples/example-gateway/build/clients/corge-http/mock-client/mock_client.go +++ b/examples/example-gateway/build/clients/corge-http/mock-client/mock_client.go @@ -10,7 +10,7 @@ import ( gomock "github.com/golang/mock/gomock" corge "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients-idl/clients/corge/corge" - zanzibar "github.com/uber/zanzibar/runtime" + runtime "github.com/uber/zanzibar/runtime" ) // MockClient is a mock of Client interface. @@ -71,10 +71,10 @@ func (mr *MockClientMockRecorder) EchoString(arg0, arg1, arg2 interface{}) *gomo } // HTTPClient mocks base method. -func (m *MockClient) HTTPClient() *zanzibar.HTTPClient { +func (m *MockClient) HTTPClient() *runtime.HTTPClient { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HTTPClient") - ret0, _ := ret[0].(*zanzibar.HTTPClient) + ret0, _ := ret[0].(*runtime.HTTPClient) return ret0 } diff --git a/examples/example-gateway/build/clients/custom-bar/mock-client/mock_client.go b/examples/example-gateway/build/clients/custom-bar/mock-client/mock_client.go index fc92482dc..beac1104c 100644 --- a/examples/example-gateway/build/clients/custom-bar/mock-client/mock_client.go +++ b/examples/example-gateway/build/clients/custom-bar/mock-client/mock_client.go @@ -10,7 +10,7 @@ import ( gomock "github.com/golang/mock/gomock" bar "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients-idl/clients/bar/bar" - zanzibar "github.com/uber/zanzibar/runtime" + runtime "github.com/uber/zanzibar/runtime" ) // MockClient is a mock of Client interface. @@ -509,10 +509,10 @@ func (mr *MockClientMockRecorder) EchoTypedef(arg0, arg1, arg2 interface{}) *gom } // HTTPClient mocks base method. -func (m *MockClient) HTTPClient() *zanzibar.HTTPClient { +func (m *MockClient) HTTPClient() *runtime.HTTPClient { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HTTPClient") - ret0, _ := ret[0].(*zanzibar.HTTPClient) + ret0, _ := ret[0].(*runtime.HTTPClient) return ret0 } diff --git a/examples/example-gateway/build/clients/google-now/mock-client/mock_client.go b/examples/example-gateway/build/clients/google-now/mock-client/mock_client.go index 9b6bf1e2f..3dd995128 100644 --- a/examples/example-gateway/build/clients/google-now/mock-client/mock_client.go +++ b/examples/example-gateway/build/clients/google-now/mock-client/mock_client.go @@ -10,7 +10,7 @@ import ( gomock "github.com/golang/mock/gomock" googlenow "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients-idl/clients/googlenow/googlenow" - zanzibar "github.com/uber/zanzibar/runtime" + runtime "github.com/uber/zanzibar/runtime" ) // MockClient is a mock of Client interface. @@ -69,10 +69,10 @@ func (mr *MockClientMockRecorder) CheckCredentials(arg0, arg1 interface{}) *gomo } // HTTPClient mocks base method. -func (m *MockClient) HTTPClient() *zanzibar.HTTPClient { +func (m *MockClient) HTTPClient() *runtime.HTTPClient { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HTTPClient") - ret0, _ := ret[0].(*zanzibar.HTTPClient) + ret0, _ := ret[0].(*runtime.HTTPClient) return ret0 } diff --git a/examples/example-gateway/build/clients/multi/mock-client/mock_client.go b/examples/example-gateway/build/clients/multi/mock-client/mock_client.go index 5015445cc..0babdd9aa 100644 --- a/examples/example-gateway/build/clients/multi/mock-client/mock_client.go +++ b/examples/example-gateway/build/clients/multi/mock-client/mock_client.go @@ -9,7 +9,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - zanzibar "github.com/uber/zanzibar/runtime" + runtime "github.com/uber/zanzibar/runtime" ) // MockClient is a mock of Client interface. @@ -36,10 +36,10 @@ func (m *MockClient) EXPECT() *MockClientMockRecorder { } // HTTPClient mocks base method. -func (m *MockClient) HTTPClient() *zanzibar.HTTPClient { +func (m *MockClient) HTTPClient() *runtime.HTTPClient { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HTTPClient") - ret0, _ := ret[0].(*zanzibar.HTTPClient) + ret0, _ := ret[0].(*runtime.HTTPClient) return ret0 } diff --git a/examples/example-gateway/build/clients/withexceptions/mock-client/mock_client.go b/examples/example-gateway/build/clients/withexceptions/mock-client/mock_client.go index 11dbc0b22..3f78c9df3 100644 --- a/examples/example-gateway/build/clients/withexceptions/mock-client/mock_client.go +++ b/examples/example-gateway/build/clients/withexceptions/mock-client/mock_client.go @@ -10,7 +10,7 @@ import ( gomock "github.com/golang/mock/gomock" withexceptions "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients-idl/clients/withexceptions/withexceptions" - zanzibar "github.com/uber/zanzibar/runtime" + runtime "github.com/uber/zanzibar/runtime" ) // MockClient is a mock of Client interface. @@ -54,10 +54,10 @@ func (mr *MockClientMockRecorder) Func1(arg0, arg1 interface{}) *gomock.Call { } // HTTPClient mocks base method. -func (m *MockClient) HTTPClient() *zanzibar.HTTPClient { +func (m *MockClient) HTTPClient() *runtime.HTTPClient { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HTTPClient") - ret0, _ := ret[0].(*zanzibar.HTTPClient) + ret0, _ := ret[0].(*runtime.HTTPClient) return ret0 } From 6be53449601f8f8088bdb8d942761d02a6c1417e Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Thu, 29 Jun 2023 00:35:32 +0530 Subject: [PATCH 22/86] fix inconsistent log fields --- runtime/client_http_request.go | 6 ----- runtime/client_http_response.go | 3 +-- runtime/context.go | 24 +++++++++---------- runtime/grpc_client.go | 5 +--- runtime/server_http_request.go | 2 -- runtime/server_http_request_test.go | 3 --- runtime/server_http_response.go | 1 - runtime/tchannel_client_test.go | 6 ++--- runtime/tchannel_inbound_call.go | 4 +--- runtime/tchannel_outbound_call.go | 4 +--- test/endpoints/bar/bar_metrics_test.go | 16 +++++-------- .../baz/baz_simpleservice_method_call_test.go | 10 ++------ 12 files changed, 26 insertions(+), 58 deletions(-) diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index 816b56ce3..b0147c104 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -185,12 +185,6 @@ func (req *ClientHTTPRequest) WriteBytes( } req.httpReq = httpReq - req.ctx = WithLogFields(req.ctx, - zap.String(logFieldClientHTTPMethod, method), - zap.String(logFieldRequestURL, url), - zap.Time(logFieldRequestStartTime, req.startTime), - ) - return nil } diff --git a/runtime/client_http_response.go b/runtime/client_http_response.go index e8d41c75f..8b85cb9d1 100644 --- a/runtime/client_http_response.go +++ b/runtime/client_http_response.go @@ -222,8 +222,7 @@ func (res *ClientHTTPResponse) finish() { func clientHTTPLogFields(req *ClientHTTPRequest, res *ClientHTTPResponse) []zapcore.Field { fields := []zapcore.Field{ - zap.Time(logFieldRequestFinishedTime, res.finishTime), - zap.Int(logFieldResponseStatusCode, res.StatusCode), + zap.Int(logFieldClientStatusCode, res.StatusCode), } for k, v := range req.httpReq.Header { if len(v) > 0 { diff --git a/runtime/context.go b/runtime/context.go index 2b9fc22c4..8b2942d57 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -53,19 +53,17 @@ const ( const ( // thrift service::method of endpoint thrift spec - logFieldRequestMethod = "endpointThriftMethod" - logFieldRequestHTTPMethod = "method" - logFieldRequestURL = "url" - logFieldRequestPathname = "pathname" - logFieldRequestRemoteAddr = "remoteAddr" - logFieldRequestHost = "host" - logFieldRequestStartTime = "timestamp-started" - logFieldRequestFinishedTime = "timestamp-finished" - logFieldResponseStatusCode = "statusCode" - logFieldRequestUUID = "requestUUID" - logFieldEndpointID = "endpointID" - logFieldEndpointHandler = "endpointHandler" - logFieldClientHTTPMethod = "clientHTTPMethod" + logFieldRequestMethod = "endpointThriftMethod" + logFieldRequestHTTPMethod = "method" + logFieldRequestPathname = "pathname" + logFieldRequestRemoteAddr = "remoteAddr" + logFieldRequestHost = "host" + logFieldResponseStatusCode = "statusCode" + logFieldRequestUUID = "requestUUID" + logFieldEndpointID = "endpointID" + logFieldEndpointHandler = "endpointHandler" + logFieldClientStatusCode = "client_status_code" + logFieldClientRemoteAddr = "client_remote_addr" logFieldClientRequestHeaderPrefix = "Client-Req-Header" logFieldClientResponseHeaderPrefix = "Client-Res-Header" diff --git a/runtime/grpc_client.go b/runtime/grpc_client.go index 27e2d3be4..57f9244bb 100644 --- a/runtime/grpc_client.go +++ b/runtime/grpc_client.go @@ -112,10 +112,7 @@ func (c *callHelper) Finish(ctx context.Context, err error) context.Context { delta := c.finishTime.Sub(c.startTime) c.metrics.RecordTimer(ctx, clientLatency, delta) c.metrics.RecordHistogramDuration(ctx, clientLatency, delta) - fields := []zapcore.Field{ - zap.Time(logFieldRequestStartTime, c.startTime), - zap.Time(logFieldRequestFinishedTime, c.finishTime), - } + var fields []zapcore.Field ctx = WithEndpointRequestHeadersField(ctx, map[string]string{}) if c.extractor != nil { fields = append(fields, c.extractor.ExtractLogFields(ctx)...) diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index b30284dcb..53fca540e 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -78,7 +78,6 @@ func NewServerHTTPRequest( logFields := []zap.Field{ zap.String(logFieldEndpointID, endpoint.EndpointName), zap.String(logFieldEndpointHandler, endpoint.HandlerName), - zap.String(logFieldRequestURL, r.URL.Path), zap.String(logFieldRequestHTTPMethod, r.Method), zap.String(logFieldRequestRemoteAddr, r.RemoteAddr), zap.String(logFieldRequestPathname, r.URL.RequestURI()), @@ -214,7 +213,6 @@ func (req *ServerHTTPRequest) start() { func (req *ServerHTTPRequest) setupLogFields() { fields := GetLogFieldsFromCtx(req.Context()) - fields = append(fields, zap.Time(logFieldRequestStartTime, req.startTime)) if span := req.GetSpan(); span != nil { jc, ok := span.Context().(jaeger.SpanContext) if ok { diff --git a/runtime/server_http_request_test.go b/runtime/server_http_request_test.go index 0f88f2a9f..cb5446010 100644 --- a/runtime/server_http_request_test.go +++ b/runtime/server_http_request_test.go @@ -2369,12 +2369,10 @@ func testIncomingHTTPRequestServerLog(t *testing.T, isShadowRequest bool, enviro dynamicHeaders := []string{ "requestUUID", "remoteAddr", - "timestamp-started", "ts", "hostname", "host", "pid", - "timestamp-finished", zanzibar.TraceIDKey, zanzibar.TraceSpanKey, zanzibar.TraceSampledKey, @@ -2400,7 +2398,6 @@ func testIncomingHTTPRequestServerLog(t *testing.T, isShadowRequest bool, enviro "statusCode": float64(200), "endpointHandler": "foo", "endpointID": "foo", - "url": "/foo", "Accept-Encoding": "gzip", "User-Agent": "Go-http-client/1.1", diff --git a/runtime/server_http_response.go b/runtime/server_http_response.go index 4ca72c087..3a52ce0de 100644 --- a/runtime/server_http_response.go +++ b/runtime/server_http_response.go @@ -140,7 +140,6 @@ func (res *ServerHTTPResponse) finish(ctx context.Context) { func serverHTTPLogFields(req *ServerHTTPRequest, res *ServerHTTPResponse) []zapcore.Field { fields := []zapcore.Field{ - zap.Time(logFieldRequestFinishedTime, res.finishTime), zap.Int(logFieldResponseStatusCode, res.StatusCode), } diff --git a/runtime/tchannel_client_test.go b/runtime/tchannel_client_test.go index 4ab03a905..f643c841d 100644 --- a/runtime/tchannel_client_test.go +++ b/runtime/tchannel_client_test.go @@ -49,13 +49,13 @@ func TestNilCallReferenceForLogger(t *testing.T) { fields := outboundCall.logFields(ctx) // one field for each of the: - // timestamp-started, timestamp-finished, remoteAddr, requestHeader, responseHeader + // timestamp-started, timestamp-finished, clientRemoteAddr, requestHeader, responseHeader assert.Len(t, fields, 6) var addr, reqKey, resKey, foo bool for _, f := range fields { switch f.Key { - case "remoteAddr": + case "clientRemoteAddr": assert.Equal(t, f.String, "unknown") addr = true case "Client-Req-Header-header-key": @@ -69,7 +69,7 @@ func TestNilCallReferenceForLogger(t *testing.T) { foo = true } } - assert.True(t, addr, "remoteAddr key not present") + assert.True(t, addr, "clientRemoteAddr key not present") assert.True(t, reqKey, "Client-Req-Header-header-key key not present") assert.True(t, resKey, "Client-Res-Header-header-key key not present") assert.True(t, foo, "foo key not present") diff --git a/runtime/tchannel_inbound_call.go b/runtime/tchannel_inbound_call.go index 9193ea4b4..26e7334ec 100644 --- a/runtime/tchannel_inbound_call.go +++ b/runtime/tchannel_inbound_call.go @@ -82,10 +82,8 @@ func (c *tchannelInboundCall) finish(ctx context.Context, err error) { func (c *tchannelInboundCall) logFields(ctx context.Context) []zap.Field { fields := []zap.Field{ - zap.String("remoteAddr", c.call.RemotePeer().HostPort), + zap.String(logFieldRequestRemoteAddr, c.call.RemotePeer().HostPort), zap.String("calling-service", c.call.CallerName()), - zap.Time("timestamp-started", c.startTime), - zap.Time("timestamp-finished", c.finishTime), } for k, v := range c.resHeaders { diff --git a/runtime/tchannel_outbound_call.go b/runtime/tchannel_outbound_call.go index 7bf79a64e..d799751e3 100644 --- a/runtime/tchannel_outbound_call.go +++ b/runtime/tchannel_outbound_call.go @@ -91,9 +91,7 @@ func (c *tchannelOutboundCall) logFields(ctx context.Context) []zapcore.Field { hostPort = "unknown" } fields := []zapcore.Field{ - zap.String("remoteAddr", hostPort), - zap.Time("timestamp-started", c.startTime), - zap.Time("timestamp-finished", c.finishTime), + zap.String(logFieldClientRemoteAddr, hostPort), } headers := map[string]string{} diff --git a/test/endpoints/bar/bar_metrics_test.go b/test/endpoints/bar/bar_metrics_test.go index 4b4c7764d..9325b324a 100644 --- a/test/endpoints/bar/bar_metrics_test.go +++ b/test/endpoints/bar/bar_metrics_test.go @@ -200,13 +200,10 @@ func TestCallMetrics(t *testing.T) { assert.Len(t, logMsgs, 1) logMsg := logMsgs[0] dynamicHeaders := []string{ - "url", - "timestamp-finished", "Client-Req-Header-Uber-Trace-Id", "Client-Req-Header-X-Request-Uuid", "Client-Res-Header-Content-Length", "Client-Res-Header-Date", - "timestamp-started", "ts", "hostname", "pid", @@ -222,20 +219,19 @@ func TestCallMetrics(t *testing.T) { delete(logMsg, dynamicValue) } expectedValues := map[string]interface{}{ - "env": "test", - "level": "debug", - "msg": "Finished an outgoing client HTTP request", - "statusCode": float64(200), - "method": "POST", - "pathname": "/bar/bar-path", + "env": "test", + "level": "debug", + "msg": "Finished an outgoing client HTTP request", + "method": "POST", + "pathname": "/bar/bar-path", //"clientID": "bar", //"clientMethod": "Normal", //"clientThriftMethod": "Bar::normal", - "clientHTTPMethod": "POST", "Client-Req-Header-X-Client-Id": "bar", "Client-Req-Header-Content-Type": "application/json", "Client-Req-Header-Accept": "application/json", "Client-Res-Header-Content-Type": "text/plain; charset=utf-8", + "client_status_code": float64(200), "zone": "unknown", "service": "example-gateway", diff --git a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go index d05e2889b..075ec30c0 100644 --- a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go +++ b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go @@ -125,13 +125,12 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { logs := allLogs["Finished an incoming server TChannel request"][0] dynamicHeaders := []string{ "requestUUID", - "timestamp-started", - "timestamp-finished", "remoteAddr", "ts", "hostname", "pid", "Res-Header-client.response.duration", + "client_remote_addr", } for _, dynamicValue := range dynamicHeaders { assert.Contains(t, logs, dynamicValue) @@ -165,13 +164,12 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { dynamicHeaders = []string{ "requestUUID", "remoteAddr", - "timestamp-started", "ts", "hostname", "pid", - "timestamp-finished", "Client-Req-Header-x-request-uuid", "Client-Req-Header-$tracing$uber-trace-id", + "client_remote_addr", zanzibar.TraceIDKey, zanzibar.TraceSpanKey, zanzibar.TraceSampledKey, @@ -198,10 +196,6 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { "Regionname": "sf", // client specific logs - //"clientID": "baz", - //"clientService": "bazService", - //"clientThriftMethod": "SimpleService::call", - //"clientMethod": "Call", "Client-Req-Header-Device": "ios", "Client-Req-Header-x-uuid": "uuid", "Client-Req-Header-Regionname": "sf", From 7e97d1ba85d23bf8e3e89340302dc751c5dd358f Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Thu, 29 Jun 2023 10:27:47 +0530 Subject: [PATCH 23/86] fix test --- runtime/client_http_request_test.go | 6 +----- runtime/tchannel_client_test.go | 8 ++++---- .../tchannel/baz/baz_simpleservice_method_call_test.go | 4 +--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/runtime/client_http_request_test.go b/runtime/client_http_request_test.go index e5b859f20..48796977a 100644 --- a/runtime/client_http_request_test.go +++ b/runtime/client_http_request_test.go @@ -411,11 +411,8 @@ func TestMakingClientCallWithRespHeaders(t *testing.T) { logMsg := logMsgs[0] dynamicHeaders := []string{ - "url", - "timestamp-finished", "Client-Req-Header-Uber-Trace-Id", "Client-Res-Header-Content-Length", - "timestamp-started", "Client-Res-Header-Date", "ts", "hostname", @@ -432,13 +429,12 @@ func TestMakingClientCallWithRespHeaders(t *testing.T) { "env": "test", "zone": "unknown", "service": "example-gateway", - "statusCode": float64(200), - "clientHTTPMethod": "POST", "Client-Req-Header-X-Client-Id": "bar", "Client-Req-Header-Content-Type": "application/json", "Client-Req-Header-Accept": "application/json", "Client-Res-Header-Example-Header": "Example-Value", "Client-Res-Header-Content-Type": "text/plain; charset=utf-8", + "client_status_code": float64(200), } for actualKey, actualValue := range logMsg { assert.Equal(t, expectedValues[actualKey], actualValue, "unexpected field %q", actualKey) diff --git a/runtime/tchannel_client_test.go b/runtime/tchannel_client_test.go index f643c841d..d0d03fe51 100644 --- a/runtime/tchannel_client_test.go +++ b/runtime/tchannel_client_test.go @@ -49,13 +49,13 @@ func TestNilCallReferenceForLogger(t *testing.T) { fields := outboundCall.logFields(ctx) // one field for each of the: - // timestamp-started, timestamp-finished, clientRemoteAddr, requestHeader, responseHeader - assert.Len(t, fields, 6) + // client_remote_addr, requestHeader, responseHeader + assert.Len(t, fields, 4) var addr, reqKey, resKey, foo bool for _, f := range fields { switch f.Key { - case "clientRemoteAddr": + case "client_remote_addr": assert.Equal(t, f.String, "unknown") addr = true case "Client-Req-Header-header-key": @@ -69,7 +69,7 @@ func TestNilCallReferenceForLogger(t *testing.T) { foo = true } } - assert.True(t, addr, "clientRemoteAddr key not present") + assert.True(t, addr, "client_remote_addr key not present") assert.True(t, reqKey, "Client-Req-Header-header-key key not present") assert.True(t, resKey, "Client-Res-Header-header-key key not present") assert.True(t, foo, "foo key not present") diff --git a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go index 075ec30c0..026edaeb0 100644 --- a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go +++ b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go @@ -130,7 +130,6 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { "hostname", "pid", "Res-Header-client.response.duration", - "client_remote_addr", } for _, dynamicValue := range dynamicHeaders { assert.Contains(t, logs, dynamicValue) @@ -163,13 +162,12 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { logs = allLogs["Finished an outgoing client TChannel request"][0] dynamicHeaders = []string{ "requestUUID", - "remoteAddr", + "client_remote_addr", "ts", "hostname", "pid", "Client-Req-Header-x-request-uuid", "Client-Req-Header-$tracing$uber-trace-id", - "client_remote_addr", zanzibar.TraceIDKey, zanzibar.TraceSpanKey, zanzibar.TraceSampledKey, From 1db5153ce3dc7ae75ae67bd1838407a85f26dc40 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 30 Jun 2023 12:31:11 +0530 Subject: [PATCH 24/86] log error_type, error_location --- codegen/templates/tchannel_client.tmpl | 17 ++++++++++++++--- runtime/context.go | 13 +++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index c71032147..720688416 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -353,6 +353,17 @@ type {{$clientName}} struct { var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if (c.circuitBreakerDisabled) { success, respHeaders, err = c.client.Call( ctx, "{{$svc.Name}}", "{{.Name}}", reqHeaders, args, &result) @@ -392,7 +403,7 @@ type {{$clientName}} struct { {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding") success = true {{end -}} default: @@ -401,7 +412,7 @@ type {{$clientName}} struct { } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") {{if eq .ResponseType "" -}} return ctx, respHeaders, err {{else -}} @@ -415,7 +426,7 @@ type {{$clientName}} struct { resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err {{end -}} diff --git a/runtime/context.go b/runtime/context.go index 8b2942d57..d606f1c97 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -68,6 +68,12 @@ const ( logFieldClientRequestHeaderPrefix = "Client-Req-Header" logFieldClientResponseHeaderPrefix = "Client-Res-Header" logFieldEndpointResponseHeaderPrefix = "Res-Header" + + // LogFieldErrorLocation is field name to log error location. + LogFieldErrorLocation = "error_location" + + // LogFieldErrorType is field name to log error type. + LogFieldErrorType = "error_type" ) const ( @@ -388,6 +394,9 @@ type ContextLogger interface { Check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry SetSkipZanzibarLogs(bool) + + // Append appends the fields to the context. + Append(ctx context.Context, fields ...zap.Field) context.Context } // NewContextLogger returns a logger that extracts log fields a context before passing through to underlying zap logger. @@ -412,6 +421,10 @@ type contextLogger struct { skipZanzibarLogs bool } +func (c *contextLogger) Append(ctx context.Context, fields ...zap.Field) context.Context { + return WithLogFields(ctx, fields...) +} + func (c *contextLogger) Debug(ctx context.Context, msg string, userFields ...zap.Field) context.Context { c.log.Debug(msg, accumulateLogFields(ctx, userFields)...) return ctx From db7fdaca7194ce1f36ddff92ff40716c63b1d2ee Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Fri, 30 Jun 2023 07:14:01 +0000 Subject: [PATCH 25/86] codegen --- codegen/template_bundle/template_files.go | 19 +- .../example-gateway/build/clients/baz/baz.go | 443 +++++++++++++++--- .../build/clients/corge/corge.go | 17 +- 3 files changed, 399 insertions(+), 80 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index bea6108d2..f5ba2eb1b 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -3913,6 +3913,17 @@ type {{$clientName}} struct { var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if (c.circuitBreakerDisabled) { success, respHeaders, err = c.client.Call( ctx, "{{$svc.Name}}", "{{.Name}}", reqHeaders, args, &result) @@ -3952,7 +3963,7 @@ type {{$clientName}} struct { {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding") success = true {{end -}} default: @@ -3961,7 +3972,7 @@ type {{$clientName}} struct { } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") {{if eq .ResponseType "" -}} return ctx, respHeaders, err {{else -}} @@ -3975,7 +3986,7 @@ type {{$clientName}} struct { resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err {{end -}} @@ -3995,7 +4006,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16115, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16393, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/baz/baz.go b/examples/example-gateway/build/clients/baz/baz.go index 987339520..67d140c95 100644 --- a/examples/example-gateway/build/clients/baz/baz.go +++ b/examples/example-gateway/build/clients/baz/baz.go @@ -505,6 +505,17 @@ func (c *bazClient) EchoBinary( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoBinary", reqHeaders, args, &result) @@ -539,7 +550,7 @@ func (c *bazClient) EchoBinary( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoBinary. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoBinary. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBinary") @@ -547,14 +558,14 @@ func (c *bazClient) EchoBinary( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoBinary_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -573,6 +584,17 @@ func (c *bazClient) EchoBool( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoBool", reqHeaders, args, &result) @@ -607,7 +629,7 @@ func (c *bazClient) EchoBool( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoBool. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoBool. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBool") @@ -615,14 +637,14 @@ func (c *bazClient) EchoBool( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoBool_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -641,6 +663,17 @@ func (c *bazClient) EchoDouble( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoDouble", reqHeaders, args, &result) @@ -675,7 +708,7 @@ func (c *bazClient) EchoDouble( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoDouble. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoDouble. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoDouble") @@ -683,14 +716,14 @@ func (c *bazClient) EchoDouble( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoDouble_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -709,6 +742,17 @@ func (c *bazClient) EchoEnum( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoEnum", reqHeaders, args, &result) @@ -743,7 +787,7 @@ func (c *bazClient) EchoEnum( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoEnum. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoEnum. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoEnum") @@ -751,14 +795,14 @@ func (c *bazClient) EchoEnum( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoEnum_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -777,6 +821,17 @@ func (c *bazClient) EchoI16( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoI16", reqHeaders, args, &result) @@ -811,7 +866,7 @@ func (c *bazClient) EchoI16( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI16. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI16. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI16") @@ -819,14 +874,14 @@ func (c *bazClient) EchoI16( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoI16_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -845,6 +900,17 @@ func (c *bazClient) EchoI32( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoI32", reqHeaders, args, &result) @@ -879,7 +945,7 @@ func (c *bazClient) EchoI32( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI32. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI32. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI32") @@ -887,14 +953,14 @@ func (c *bazClient) EchoI32( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoI32_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -913,6 +979,17 @@ func (c *bazClient) EchoI64( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoI64", reqHeaders, args, &result) @@ -947,7 +1024,7 @@ func (c *bazClient) EchoI64( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI64. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI64. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI64") @@ -955,14 +1032,14 @@ func (c *bazClient) EchoI64( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoI64_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -981,6 +1058,17 @@ func (c *bazClient) EchoI8( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoI8", reqHeaders, args, &result) @@ -1015,7 +1103,7 @@ func (c *bazClient) EchoI8( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI8. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI8. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI8") @@ -1023,14 +1111,14 @@ func (c *bazClient) EchoI8( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoI8_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1049,6 +1137,17 @@ func (c *bazClient) EchoString( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoString", reqHeaders, args, &result) @@ -1083,7 +1182,7 @@ func (c *bazClient) EchoString( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoString. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoString. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoString") @@ -1091,14 +1190,14 @@ func (c *bazClient) EchoString( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoString_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1117,6 +1216,17 @@ func (c *bazClient) EchoStringList( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStringList", reqHeaders, args, &result) @@ -1151,7 +1261,7 @@ func (c *bazClient) EchoStringList( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringList. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringList. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringList") @@ -1159,14 +1269,14 @@ func (c *bazClient) EchoStringList( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringList_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1185,6 +1295,17 @@ func (c *bazClient) EchoStringMap( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStringMap", reqHeaders, args, &result) @@ -1219,7 +1340,7 @@ func (c *bazClient) EchoStringMap( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringMap. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringMap. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringMap") @@ -1227,14 +1348,14 @@ func (c *bazClient) EchoStringMap( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringMap_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1253,6 +1374,17 @@ func (c *bazClient) EchoStringSet( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStringSet", reqHeaders, args, &result) @@ -1287,7 +1419,7 @@ func (c *bazClient) EchoStringSet( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringSet. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringSet. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringSet") @@ -1295,14 +1427,14 @@ func (c *bazClient) EchoStringSet( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringSet_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1321,6 +1453,17 @@ func (c *bazClient) EchoStructList( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStructList", reqHeaders, args, &result) @@ -1355,7 +1498,7 @@ func (c *bazClient) EchoStructList( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStructList. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStructList. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructList") @@ -1363,14 +1506,14 @@ func (c *bazClient) EchoStructList( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructList_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1389,6 +1532,17 @@ func (c *bazClient) EchoStructSet( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStructSet", reqHeaders, args, &result) @@ -1423,7 +1577,7 @@ func (c *bazClient) EchoStructSet( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStructSet. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStructSet. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructSet") @@ -1431,14 +1585,14 @@ func (c *bazClient) EchoStructSet( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructSet_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1457,6 +1611,17 @@ func (c *bazClient) EchoTypedef( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoTypedef", reqHeaders, args, &result) @@ -1491,7 +1656,7 @@ func (c *bazClient) EchoTypedef( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoTypedef. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoTypedef. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoTypedef") @@ -1499,14 +1664,14 @@ func (c *bazClient) EchoTypedef( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoTypedef_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1524,6 +1689,17 @@ func (c *bazClient) Call( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "call", reqHeaders, args, &result) @@ -1565,7 +1741,7 @@ func (c *bazClient) Call( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, respHeaders, err } @@ -1586,6 +1762,17 @@ func (c *bazClient) Compare( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "compare", reqHeaders, args, &result) @@ -1624,7 +1811,7 @@ func (c *bazClient) Compare( case result.OtherAuthErr != nil: err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Compare. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Compare. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Compare") @@ -1632,14 +1819,14 @@ func (c *bazClient) Compare( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_Compare_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1658,6 +1845,17 @@ func (c *bazClient) GetProfile( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "getProfile", reqHeaders, args, &result) @@ -1694,7 +1892,7 @@ func (c *bazClient) GetProfile( case result.AuthErr != nil: err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for GetProfile") @@ -1702,14 +1900,14 @@ func (c *bazClient) GetProfile( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_GetProfile_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1728,6 +1926,17 @@ func (c *bazClient) HeaderSchema( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "headerSchema", reqHeaders, args, &result) @@ -1766,7 +1975,7 @@ func (c *bazClient) HeaderSchema( case result.OtherAuthErr != nil: err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for HeaderSchema") @@ -1774,14 +1983,14 @@ func (c *bazClient) HeaderSchema( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_HeaderSchema_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1800,6 +2009,17 @@ func (c *bazClient) Ping( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "ping", reqHeaders, args, &result) @@ -1834,7 +2054,7 @@ func (c *bazClient) Ping( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Ping. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Ping. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Ping") @@ -1842,14 +2062,14 @@ func (c *bazClient) Ping( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_Ping_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1867,6 +2087,17 @@ func (c *bazClient) DeliberateDiffNoop( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "sillyNoop", reqHeaders, args, &result) @@ -1910,7 +2141,7 @@ func (c *bazClient) DeliberateDiffNoop( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, respHeaders, err } @@ -1930,6 +2161,17 @@ func (c *bazClient) TestUUID( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "testUuid", reqHeaders, args, &result) @@ -1969,7 +2211,7 @@ func (c *bazClient) TestUUID( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, respHeaders, err } @@ -1990,6 +2232,17 @@ func (c *bazClient) Trans( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "trans", reqHeaders, args, &result) @@ -2028,7 +2281,7 @@ func (c *bazClient) Trans( case result.OtherAuthErr != nil: err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Trans. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Trans. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Trans") @@ -2036,14 +2289,14 @@ func (c *bazClient) Trans( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_Trans_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -2062,6 +2315,17 @@ func (c *bazClient) TransHeaders( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "transHeaders", reqHeaders, args, &result) @@ -2100,7 +2364,7 @@ func (c *bazClient) TransHeaders( case result.OtherAuthErr != nil: err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeaders") @@ -2108,14 +2372,14 @@ func (c *bazClient) TransHeaders( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeaders_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -2134,6 +2398,17 @@ func (c *bazClient) TransHeadersNoReq( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "transHeadersNoReq", reqHeaders, args, &result) @@ -2170,7 +2445,7 @@ func (c *bazClient) TransHeadersNoReq( case result.AuthErr != nil: err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersNoReq") @@ -2178,14 +2453,14 @@ func (c *bazClient) TransHeadersNoReq( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersNoReq_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -2204,6 +2479,17 @@ func (c *bazClient) TransHeadersType( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "transHeadersType", reqHeaders, args, &result) @@ -2242,7 +2528,7 @@ func (c *bazClient) TransHeadersType( case result.OtherAuthErr != nil: err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersType") @@ -2250,14 +2536,14 @@ func (c *bazClient) TransHeadersType( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersType_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -2275,6 +2561,17 @@ func (c *bazClient) URLTest( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "urlTest", reqHeaders, args, &result) @@ -2314,7 +2611,7 @@ func (c *bazClient) URLTest( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, respHeaders, err } diff --git a/examples/example-gateway/build/clients/corge/corge.go b/examples/example-gateway/build/clients/corge/corge.go index f91767440..f9f4cb910 100644 --- a/examples/example-gateway/build/clients/corge/corge.go +++ b/examples/example-gateway/build/clients/corge/corge.go @@ -324,6 +324,17 @@ func (c *corgeClient) EchoString( var success bool respHeaders := make(map[string]string) var err error + defer func() { + if err != nil { + ctx = logger.Append(ctx, zap.Error(err)) + if zErr, ok := err.(zanzibar.Error); ok { + ctx = logger.Append(ctx, + zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), + zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), + ) + } + } + }() if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "Corge", "echoString", reqHeaders, args, &result) @@ -358,7 +369,7 @@ func (c *corgeClient) EchoString( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoString. Overriding", zap.Error(err)) + ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoString. Overriding") success = true default: err = errors.New("corgeClient received no result or unknown exception for EchoString") @@ -366,14 +377,14 @@ func (c *corgeClient) EchoString( } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsCorgeCorge.Corge_EchoString_Helper.UnwrapResponse(&result) if err != nil { err = c.errorBuilder.Error(err, zanzibar.ClientException) - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } From 16f7b0001131148724091394247088cfa13ed5ec Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Sat, 1 Jul 2023 23:55:34 +0530 Subject: [PATCH 26/86] add safe fields --- runtime/context.go | 48 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/runtime/context.go b/runtime/context.go index a173a9b76..a9ad1c00c 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -23,6 +23,7 @@ package zanzibar import ( "context" "strconv" + "sync" "time" "github.com/uber-go/tally" @@ -44,10 +45,10 @@ const ( routingDelegateKey = contextFieldKey("rd") shardKey = contextFieldKey("sk") endpointRequestHeader = contextFieldKey("endpointRequestHeader") - requestLogFields = contextFieldKey("requestLogFields") scopeTags = contextFieldKey("scopeTags") ctxLogCounterName = contextFieldKey("ctxLogCounter") ctxLogLevel = contextFieldKey("ctxLogLevel") + safeFieldsKey = contextFieldKey("safeFields") ) const ( @@ -187,21 +188,49 @@ func GetShardKeyFromCtx(ctx context.Context) string { return "" } +type safeFields struct { + mu sync.Mutex + fields []zap.Field +} + +func (sf *safeFields) append(fields []zap.Field) { + sf.mu.Lock() + sf.fields = append(sf.fields, fields...) + sf.mu.Unlock() +} + +func (sf *safeFields) getFields() []zap.Field { + sf.mu.Lock() + defer sf.mu.Unlock() + return sf.fields +} + +func getSafeFieldsFromContext(ctx context.Context) *safeFields { + v := ctx.Value(safeFieldsKey).(*safeFields) + if v != nil { + return v + } + return &safeFields{} +} + // WithLogFields returns a new context with the given log fields attached to context.Context +// +// Deprecated: Use ContextLogger.Append instead. func WithLogFields(ctx context.Context, newFields ...zap.Field) context.Context { - return context.WithValue(ctx, requestLogFields, accumulateLogFields(ctx, newFields)) + sf := getSafeFieldsFromContext(ctx) + sf.append(newFields) + return context.WithValue(ctx, safeFieldsKey, sf) } // GetLogFieldsFromCtx returns the log fields attached to the context.Context func GetLogFieldsFromCtx(ctx context.Context) []zap.Field { - var fields []zap.Field if ctx != nil { - v := ctx.Value(requestLogFields) + v := ctx.Value(safeFieldsKey) if v != nil { - fields = v.([]zap.Field) + return v.(*safeFields).getFields() } } - return fields + return []zap.Field{} } // WithScopeTags adds tags to context without updating the scope @@ -381,7 +410,7 @@ type ContextLogger interface { SetSkipZanzibarLogs(bool) // Append appends the fields to the context. - Append(ctx context.Context, fields ...zap.Field) context.Context + Append(ctx context.Context, fields ...zap.Field) } // NewContextLogger returns a logger that extracts log fields a context before passing through to underlying zap logger. @@ -406,8 +435,9 @@ type contextLogger struct { skipZanzibarLogs bool } -func (c *contextLogger) Append(ctx context.Context, fields ...zap.Field) context.Context { - return WithLogFields(ctx, fields...) +func (c *contextLogger) Append(ctx context.Context, fields ...zap.Field) { + v := getSafeFieldsFromContext(ctx) + v.append(fields) } func (c *contextLogger) Debug(ctx context.Context, msg string, userFields ...zap.Field) context.Context { From 9ea9fb842aa31c66cdcfbe56bd3f9f80cdc82c8f Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Sun, 2 Jul 2023 00:20:44 +0530 Subject: [PATCH 27/86] remove duplicate log --- codegen/templates/tchannel_client.tmpl | 4 ++-- runtime/context.go | 5 +++++ runtime/router.go | 2 ++ runtime/server_http_request.go | 4 ++-- runtime/tchannel_outbound_call.go | 23 ++++------------------- 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index dfbc88aaf..240ecf466 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -358,9 +358,9 @@ type {{$clientName}} struct { var err error defer func() { if err != nil { - ctx = logger.Append(ctx, zap.Error(err)) + logger.Append(ctx, zap.Error(err)) if zErr, ok := err.(zanzibar.Error); ok { - ctx = logger.Append(ctx, + logger.Append(ctx, zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), ) diff --git a/runtime/context.go b/runtime/context.go index a9ad1c00c..d091c5e4c 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -193,6 +193,11 @@ type safeFields struct { fields []zap.Field } +// WithSafeLogFields initiates empty safeFields in the context. +func WithSafeLogFields(ctx context.Context) context.Context { + return context.WithValue(ctx, safeFieldsKey, &safeFields{}) +} + func (sf *safeFields) append(fields []zap.Field) { sf.mu.Lock() sf.fields = append(sf.fields, fields...) diff --git a/runtime/router.go b/runtime/router.go index 0b265d852..fc428d9a1 100644 --- a/runtime/router.go +++ b/runtime/router.go @@ -255,6 +255,7 @@ func (router *httpRouter) handleNotFound( ctx := r.Context() ctx = WithScopeTagsDefault(ctx, scopeTags, router.gateway.RootScope) + ctx = WithSafeLogFields(ctx) r = r.WithContext(ctx) req := NewServerHTTPRequest(w, r, nil, router.notFoundEndpoint) http.NotFound(w, r) @@ -274,6 +275,7 @@ func (router *httpRouter) handleMethodNotAllowed( ctx := r.Context() ctx = WithScopeTagsDefault(ctx, scopeTags, router.gateway.RootScope) + ctx = WithSafeLogFields(ctx) r = r.WithContext(ctx) req := NewServerHTTPRequest(w, r, nil, router.methodNotAllowedEndpoint) http.Error(w, diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index 53fca540e..795690fb8 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -73,6 +73,7 @@ func NewServerHTTPRequest( endpoint *RouterEndpoint, ) *ServerHTTPRequest { ctx := r.Context() + logger := endpoint.contextLogger // put request log fields on context logFields := []zap.Field{ @@ -122,12 +123,11 @@ func NewServerHTTPRequest( } ctx = WithScopeTagsDefault(ctx, scopeTags, endpoint.scope) - ctx = WithLogFields(ctx, logFields...) + logger.Append(ctx, logFields...) httpRequest := r.WithContext(ctx) scope := getScope(ctx, endpoint.scope) // use the calculated scope instead of making a new one - logger := endpoint.contextLogger req := &ServerHTTPRequest{ httpRequest: httpRequest, diff --git a/runtime/tchannel_outbound_call.go b/runtime/tchannel_outbound_call.go index d799751e3..e440aad79 100644 --- a/runtime/tchannel_outbound_call.go +++ b/runtime/tchannel_outbound_call.go @@ -73,17 +73,10 @@ func (c *tchannelOutboundCall) finish(ctx context.Context, err error) { c.metrics.RecordHistogramDuration(ctx, clientLatencyHist, delta) c.duration = delta - // write logs - fields := c.logFields(ctx) - if err == nil { - c.contextLogger.Debug(ctx, "Finished an outgoing client TChannel request", fields...) - } else { - fields = append(fields, zap.Error(err)) - c.contextLogger.Warn(ctx, "Failed to send outgoing client TChannel request", fields...) - } + c.contextLogger.Append(ctx, c.logFields()...) } -func (c *tchannelOutboundCall) logFields(ctx context.Context) []zapcore.Field { +func (c *tchannelOutboundCall) logFields() []zapcore.Field { var hostPort string if c.call != nil { hostPort = c.call.RemotePeer().HostPort @@ -105,17 +98,9 @@ func (c *tchannelOutboundCall) logFields(ctx context.Context) []zapcore.Field { headers[s] = v } - // If an extractor function is provided, use it, else copy all the headers - if c.client != nil && c.client.contextExtractor != nil { - ctx = WithEndpointRequestHeadersField(ctx, headers) - fields = append(fields, c.client.contextExtractor.ExtractLogFields(ctx)...) - } else { - for k, v := range headers { - fields = append(fields, zap.String(k, v)) - } + for k, v := range headers { + fields = append(fields, zap.String(k, v)) } - - fields = append(fields, GetLogFieldsFromCtx(ctx)...) return fields } From 9416c29fd1866f3addb526f3d00e576b02ade21e Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Sun, 2 Jul 2023 10:36:27 +0530 Subject: [PATCH 28/86] hide sensitive headers in logs --- runtime/constants.go | 4 ++++ runtime/server_http_request.go | 23 +++++++++++++++++++++-- runtime/tchannel_client_test.go | 2 +- runtime/utils.go | 20 ++++++++++++++++++++ runtime/utils_test.go | 28 ++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 runtime/utils_test.go diff --git a/runtime/constants.go b/runtime/constants.go index 50ac50fa5..7b7ff97bf 100644 --- a/runtime/constants.go +++ b/runtime/constants.go @@ -178,3 +178,7 @@ var DefaultBackOffTimeAcrossRetries = time.Duration(DefaultBackOffTimeAcrossRetr // DefaultScaleFactor is multiplied with timeoutPerAttempt var DefaultScaleFactor = 1.1 + +var DefaultSensitiveHeaders = map[string]bool{ + "utoken-caller": true, +} diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index 795690fb8..c6e2f0488 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -94,9 +94,12 @@ func NewServerHTTPRequest( if endpoint.contextExtractor != nil { headers := map[string]string{} + sensitiveHeaders := getSensitiveHeadersMap(endpoint) for k, v := range r.Header { - // TODO: this 0th element logic is probably not correct - headers[k] = v[0] + if !sensitiveHeaders[strings.ToLower(k)] { + // TODO: this 0th element logic is probably not correct + headers[k] = v[0] + } } ctx = WithEndpointRequestHeadersField(ctx, headers) for k, v := range endpoint.contextExtractor.ExtractScopeTags(ctx) { @@ -149,6 +152,22 @@ func NewServerHTTPRequest( return req } +func getSensitiveHeadersMap(endpoint *RouterEndpoint) map[string]bool { + sensitiveHeaders := make(map[string]bool) + sensitiveHeadersKey := fmt.Sprintf("endpoints.%s.%s.sensitive_headers", endpoint.EndpointName, endpoint.HandlerName) + if endpoint.config.ContainsKey(sensitiveHeadersKey) { + v := endpoint.config.MustGetString(sensitiveHeadersKey) + headersList := getStringSliceFromCSV(v) + for _, h := range headersList { + sensitiveHeaders[h] = true + } + } + for k := range DefaultSensitiveHeaders { + sensitiveHeaders[k] = true + } + return sensitiveHeaders +} + // GetAPIEnvironment returns the api environment for a given request. // By default, the api environment is set to production. However, there may be // use cases where a different environment may be required for monitoring purposes. diff --git a/runtime/tchannel_client_test.go b/runtime/tchannel_client_test.go index d0d03fe51..086a0e2b0 100644 --- a/runtime/tchannel_client_test.go +++ b/runtime/tchannel_client_test.go @@ -46,7 +46,7 @@ func TestNilCallReferenceForLogger(t *testing.T) { ctx := context.TODO() ctx = WithLogFields(ctx, zap.String("foo", "bar")) - fields := outboundCall.logFields(ctx) + fields := outboundCall.logFields() // one field for each of the: // client_remote_addr, requestHeader, responseHeader diff --git a/runtime/utils.go b/runtime/utils.go index 4d3422e9f..b7dd0f9b6 100644 --- a/runtime/utils.go +++ b/runtime/utils.go @@ -41,3 +41,23 @@ func BuildTimeoutAndRetryConfig(timeoutPerAttemptConf int, backOffTimeAcrossRetr BackOffTimeAcrossRetriesInMs: backOffTimeAcrossRetries, } } + +func getStringSliceFromCSV(s string) []string { + var arr []string + var i, j int + n := len(s) + for { + for ; j < n && (s[j] == ' ' || s[j] == ','); j++ { + i = j + 1 + } + if j == n { + break + } + for ; j < n && !(s[j] == ' ' || s[j] == ','); j++ { + } + if i < j { + arr = append(arr, s[i:j]) + } + } + return arr +} diff --git a/runtime/utils_test.go b/runtime/utils_test.go new file mode 100644 index 000000000..4344a7397 --- /dev/null +++ b/runtime/utils_test.go @@ -0,0 +1,28 @@ +package zanzibar + +import ( + "github.com/stretchr/testify/assert" + "strconv" + "testing" +) + +func Test_getStringSliceFromCSV(t *testing.T) { + table := []struct { + csv string + want []string + }{ + {"Content-Type,host,X-Uber-Uuid", + []string{"Content-Type", "host", "X-Uber-Uuid"}, + }, + {"Content-Type, host , X-Uber-Uuid, ", + []string{"Content-Type", "host", "X-Uber-Uuid"}, + }, + } + + for i, tt := range table { + t.Run("test"+strconv.Itoa(i), func(t *testing.T) { + got := getStringSliceFromCSV(tt.csv) + assert.Equal(t, tt.want, got) + }) + } +} From 6b35cd24e0ae65f37a779173fe81c039bd16dd83 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Sun, 2 Jul 2023 22:24:45 +0530 Subject: [PATCH 29/86] remove redundant log fields duplicating header log fields --- runtime/constants.go | 1 - runtime/server_http_request.go | 2 -- 2 files changed, 3 deletions(-) diff --git a/runtime/constants.go b/runtime/constants.go index 7b7ff97bf..2907b0691 100644 --- a/runtime/constants.go +++ b/runtime/constants.go @@ -61,7 +61,6 @@ const ( // shadow headers and environment shadowEnvironment = "shadow" environmentKey = "env" - apienvironmentKey = "apienvironment" // HTTPStatusClientClosedRequest code describes client closed request as per this doc https://httpstatus.in/499/ HTTPStatusClientClosedRequest = 499 diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index c6e2f0488..24b1b2513 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -112,7 +112,6 @@ func NewServerHTTPRequest( // Overriding the api-environment and default to production apiEnvironment := GetAPIEnvironment(endpoint, r) scopeTags[scopeTagsAPIEnvironment] = apiEnvironment - logFields = append(logFields, zap.String(apienvironmentKey, apiEnvironment)) // Overriding the environment for shadow requests if endpoint.config != nil { @@ -121,7 +120,6 @@ func NewServerHTTPRequest( endpoint.config.ContainsKey("shadowRequestHeader") && r.Header.Get(endpoint.config.MustGetString("shadowRequestHeader")) != "" { scopeTags[environmentKey] = shadowEnvironment - logFields = append(logFields, zap.String(environmentKey, shadowEnvironment)) } } From 8a1af10a0d38328783926e78c42bbb718425bd4d Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Mon, 3 Jul 2023 04:12:48 +0000 Subject: [PATCH 30/86] add license to utils_test.go --- runtime/utils_test.go | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/runtime/utils_test.go b/runtime/utils_test.go index 4344a7397..a9a5d9b02 100644 --- a/runtime/utils_test.go +++ b/runtime/utils_test.go @@ -1,9 +1,30 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zanzibar import ( - "github.com/stretchr/testify/assert" "strconv" "testing" + + "github.com/stretchr/testify/assert" ) func Test_getStringSliceFromCSV(t *testing.T) { From ebf78fb0f2e48f8cf6f8fb67a7595e4f311ff33f Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Tue, 4 Jul 2023 18:12:44 +0530 Subject: [PATCH 31/86] revert changes --- codegen/templates/endpoint.tmpl | 5 +- codegen/templates/tchannel_client.tmpl | 10 +--- codegen/templates/workflow.tmpl | 33 ++++++----- runtime/error.go | 56 ------------------ runtime/error_builder.go | 78 -------------------------- runtime/error_builder_test.go | 41 -------------- runtime/errortype_string.go | 46 --------------- 7 files changed, 19 insertions(+), 250 deletions(-) delete mode 100644 runtime/error.go delete mode 100644 runtime/error_builder.go delete mode 100644 runtime/error_builder_test.go delete mode 100644 runtime/errortype_string.go diff --git a/codegen/templates/endpoint.tmpl b/codegen/templates/endpoint.tmpl index e5bd1a20b..6ec0a9262 100644 --- a/codegen/templates/endpoint.tmpl +++ b/codegen/templates/endpoint.tmpl @@ -217,10 +217,7 @@ func (h *{{$handlerName}}) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } - {{if eq (len .Exceptions) 0 -}} + {{- if eq (len .Exceptions) 0 -}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index c71032147..46441f135 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -223,7 +223,6 @@ func {{$exportName}}(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -324,7 +323,6 @@ type {{$clientName}} struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } {{range $svc := .Services}} @@ -381,14 +379,12 @@ type {{$clientName}} struct { err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { {{range .Exceptions -}} case result.{{title .Name}} != nil: - err = c.errorBuilder.Error(result.{{title .Name}}, zanzibar.ClientException) + err = result.{{title .Name}} {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -397,7 +393,6 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -414,7 +409,6 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err diff --git a/codegen/templates/workflow.tmpl b/codegen/templates/workflow.tmpl index 4b531efb0..71514b2f3 100644 --- a/codegen/templates/workflow.tmpl +++ b/codegen/templates/workflow.tmpl @@ -95,7 +95,6 @@ func New{{$workflowInterface}}(deps *module.Dependencies) {{$workflowInterface}} Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -105,7 +104,6 @@ type {{$workflowStruct}} struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -230,33 +228,34 @@ func (w {{$workflowStruct}}) Handle( {{- $responseType := .ResponseType }} if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { {{range $idx, $cException := $clientExceptions}} case *{{$cException.Type}}: - err = convert{{$methodName}}{{title $cException.Name}}( + serverErr := convert{{$methodName}}{{title $cException.Name}}( errValue, ) + {{if eq $responseType ""}} + return ctx, nil, serverErr + {{else if eq $responseType "string" }} + return ctx, "", nil, serverErr + {{else}} + return ctx, nil, nil, serverErr + {{end}} {{end}} default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "{{$clientName}}"), ) + + {{if eq $responseType ""}} + return ctx, nil, err + {{else if eq $responseType "string" }} + return ctx, "", nil, err + {{else}} + return ctx, nil, nil, err + {{end}} } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - {{if eq $responseType "" -}} - return ctx, nil, err - {{else if eq $responseType "string" -}} - return ctx, "", nil, err - {{else -}} - return ctx, nil, nil, err - {{- end -}} } // Filter and map response headers from client to server response. diff --git a/runtime/error.go b/runtime/error.go deleted file mode 100644 index 9b0f767f5..000000000 --- a/runtime/error.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2023 Uber Technologies, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package zanzibar - -// ErrorType is used for error grouping. -type ErrorType int - -const ( - // TChannelError are errors of type tchannel.SystemError - TChannelError ErrorType = iota + 1 - - // ClientException are client exceptions defined in the - // client IDL. - ClientException - - // BadResponse are errors reading client response such - // as undefined exceptions, empty response. - BadResponse -) - -//go:generate stringer -type=ErrorType - -// Error is a wrapper on go error to provide meta fields about -// error that are logged to improve error debugging, as well -// as to facilitate error grouping and filtering in logs. -type Error interface { - error - - // ErrorLocation is the module identifier that produced - // the error. It should be one of client, middleware, endpoint. - ErrorLocation() string - - // ErrorType is used for error grouping. - ErrorType() ErrorType - - // Unwrap returns wrapped error. - Unwrap() error -} diff --git a/runtime/error_builder.go b/runtime/error_builder.go deleted file mode 100644 index 649604e59..000000000 --- a/runtime/error_builder.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2023 Uber Technologies, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package zanzibar - -// ErrorBuilder wraps input error into Error. -type ErrorBuilder interface { - Error(err error, errType ErrorType) error - - Rebuild(zErr Error, err error) error -} - -// NewErrorBuilder creates an instance of ErrorBuilder. -// Input module id is used as error location for Errors -// created by this builder. -func NewErrorBuilder(moduleClassName, moduleName string) ErrorBuilder { - return errorBuilder{ - errLocation: moduleClassName + "::" + moduleName, - } -} - -type errorBuilder struct { - errLocation string -} - -type wrappedError struct { - error - errLocation string - errType ErrorType -} - -var _ Error = (*wrappedError)(nil) -var _ ErrorBuilder = (*errorBuilder)(nil) - -func (eb errorBuilder) Error(err error, errType ErrorType) error { - return wrappedError{ - error: err, - errLocation: eb.errLocation, - errType: errType, - } -} - -func (eb errorBuilder) Rebuild(zErr Error, err error) error { - return wrappedError{ - error: err, - errLocation: zErr.ErrorLocation(), - errType: zErr.ErrorType(), - } -} - -func (e wrappedError) Unwrap() error { - return e.error -} - -func (e wrappedError) ErrorLocation() string { - return e.errLocation -} - -func (e wrappedError) ErrorType() ErrorType { - return e.errType -} diff --git a/runtime/error_builder_test.go b/runtime/error_builder_test.go deleted file mode 100644 index e6d0b811e..000000000 --- a/runtime/error_builder_test.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2023 Uber Technologies, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package zanzibar_test - -import ( - "errors" - "testing" - - "github.com/stretchr/testify/assert" - zanzibar "github.com/uber/zanzibar/runtime" -) - -func TestErrorBuilder(t *testing.T) { - eb := zanzibar.NewErrorBuilder("endpoint", "foo") - err := errors.New("test error") - err2 := eb.Error(err, zanzibar.TChannelError) - - zErr, ok := err2.(zanzibar.Error) - assert.True(t, ok) - assert.Equal(t, "endpoint::foo", zErr.ErrorLocation()) - assert.Equal(t, "TChannelError", zErr.ErrorType().String()) - assert.True(t, errors.Is(err2, err)) -} diff --git a/runtime/errortype_string.go b/runtime/errortype_string.go deleted file mode 100644 index a27ff28db..000000000 --- a/runtime/errortype_string.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2023 Uber Technologies, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -// Code generated by "stringer -type=ErrorType"; DO NOT EDIT. - -package zanzibar - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[TChannelError-1] - _ = x[ClientException-2] - _ = x[BadResponse-3] -} - -const _ErrorType_name = "TChannelErrorClientExceptionBadResponse" - -var _ErrorType_index = [...]uint8{0, 13, 28, 39} - -func (i ErrorType) String() string { - i -= 1 - if i < 0 || i >= ErrorType(len(_ErrorType_index)-1) { - return "ErrorType(" + strconv.FormatInt(int64(i+1), 10) + ")" - } - return _ErrorType_name[_ErrorType_index[i]:_ErrorType_index[i+1]] -} From 0c76537c0252173204f6179df29821231048ee32 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Tue, 4 Jul 2023 12:45:27 +0000 Subject: [PATCH 32/86] remove endpoint level config for sensitive headers --- runtime/constants.go | 2 ++ runtime/server_http_request.go | 19 +------------ runtime/utils.go | 20 -------------- runtime/utils_test.go | 49 ---------------------------------- 4 files changed, 3 insertions(+), 87 deletions(-) delete mode 100644 runtime/utils_test.go diff --git a/runtime/constants.go b/runtime/constants.go index 2907b0691..006fce296 100644 --- a/runtime/constants.go +++ b/runtime/constants.go @@ -178,6 +178,8 @@ var DefaultBackOffTimeAcrossRetries = time.Duration(DefaultBackOffTimeAcrossRetr // DefaultScaleFactor is multiplied with timeoutPerAttempt var DefaultScaleFactor = 1.1 +// DefaultSensitiveHeaders is map of default sensitive headers that must not be logged. +// This set is in addition to the default headers declared per endpoint. See getSensitiveHeadersMap. var DefaultSensitiveHeaders = map[string]bool{ "utoken-caller": true, } diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index 24b1b2513..c8e56eb0e 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -94,9 +94,8 @@ func NewServerHTTPRequest( if endpoint.contextExtractor != nil { headers := map[string]string{} - sensitiveHeaders := getSensitiveHeadersMap(endpoint) for k, v := range r.Header { - if !sensitiveHeaders[strings.ToLower(k)] { + if !DefaultSensitiveHeaders[strings.ToLower(k)] { // TODO: this 0th element logic is probably not correct headers[k] = v[0] } @@ -150,22 +149,6 @@ func NewServerHTTPRequest( return req } -func getSensitiveHeadersMap(endpoint *RouterEndpoint) map[string]bool { - sensitiveHeaders := make(map[string]bool) - sensitiveHeadersKey := fmt.Sprintf("endpoints.%s.%s.sensitive_headers", endpoint.EndpointName, endpoint.HandlerName) - if endpoint.config.ContainsKey(sensitiveHeadersKey) { - v := endpoint.config.MustGetString(sensitiveHeadersKey) - headersList := getStringSliceFromCSV(v) - for _, h := range headersList { - sensitiveHeaders[h] = true - } - } - for k := range DefaultSensitiveHeaders { - sensitiveHeaders[k] = true - } - return sensitiveHeaders -} - // GetAPIEnvironment returns the api environment for a given request. // By default, the api environment is set to production. However, there may be // use cases where a different environment may be required for monitoring purposes. diff --git a/runtime/utils.go b/runtime/utils.go index 5df14aa6d..62f6e565d 100644 --- a/runtime/utils.go +++ b/runtime/utils.go @@ -41,23 +41,3 @@ func BuildTimeoutAndRetryConfig(timeoutPerAttemptConf int, backOffTimeAcrossRetr BackOffTimeAcrossRetriesInMs: backOffTimeAcrossRetries, } } - -func getStringSliceFromCSV(s string) []string { - var arr []string - var i, j int - n := len(s) - for { - for ; j < n && (s[j] == ' ' || s[j] == ','); j++ { - i = j + 1 - } - if j == n { - break - } - for ; j < n && !(s[j] == ' ' || s[j] == ','); j++ { - } - if i < j { - arr = append(arr, s[i:j]) - } - } - return arr -} diff --git a/runtime/utils_test.go b/runtime/utils_test.go deleted file mode 100644 index a9a5d9b02..000000000 --- a/runtime/utils_test.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) 2023 Uber Technologies, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package zanzibar - -import ( - "strconv" - "testing" - - "github.com/stretchr/testify/assert" -) - -func Test_getStringSliceFromCSV(t *testing.T) { - table := []struct { - csv string - want []string - }{ - {"Content-Type,host,X-Uber-Uuid", - []string{"Content-Type", "host", "X-Uber-Uuid"}, - }, - {"Content-Type, host , X-Uber-Uuid, ", - []string{"Content-Type", "host", "X-Uber-Uuid"}, - }, - } - - for i, tt := range table { - t.Run("test"+strconv.Itoa(i), func(t *testing.T) { - got := getStringSliceFromCSV(tt.csv) - assert.Equal(t, tt.want, got) - }) - } -} From 3f3e7cbc428f23e8f12d93b68c2ccd64d614e5f9 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Wed, 5 Jul 2023 05:32:48 +0000 Subject: [PATCH 33/86] codegen --- codegen/template_bundle/template_files.go | 54 ++--- .../example-gateway/build/clients/baz/baz.go | 190 ++++-------------- .../build/clients/corge/corge.go | 8 +- .../bar/bar_bar_method_argnotstruct.go | 3 - .../bar/bar_bar_method_argwithheaders.go | 3 - .../bar_bar_method_argwithmanyqueryparams.go | 3 - ...ar_bar_method_argwithneardupqueryparams.go | 3 - ...bar_bar_method_argwithnestedqueryparams.go | 3 - .../bar/bar_bar_method_argwithparams.go | 3 - ..._method_argwithparamsandduplicatefields.go | 3 - .../bar/bar_bar_method_argwithqueryheader.go | 3 - .../bar/bar_bar_method_argwithqueryparams.go | 3 - .../bar/bar_bar_method_deletewithbody.go | 3 - .../bar/bar_bar_method_helloworld.go | 3 - .../bar/bar_bar_method_listandenum.go | 3 - .../bar/bar_bar_method_missingarg.go | 3 - .../endpoints/bar/bar_bar_method_norequest.go | 3 - .../endpoints/bar/bar_bar_method_normal.go | 3 - .../bar/bar_bar_method_toomanyargs.go | 3 - .../workflow/bar_bar_method_argnotstruct.go | 17 +- .../workflow/bar_bar_method_argwithheaders.go | 13 +- .../bar_bar_method_argwithmanyqueryparams.go | 13 +- ...ar_bar_method_argwithneardupqueryparams.go | 13 +- ...bar_bar_method_argwithnestedqueryparams.go | 13 +- .../workflow/bar_bar_method_argwithparams.go | 13 +- ..._method_argwithparamsandduplicatefields.go | 13 +- .../bar_bar_method_argwithqueryheader.go | 13 +- .../bar_bar_method_argwithqueryparams.go | 13 +- .../workflow/bar_bar_method_deletewithbody.go | 13 +- .../bar/workflow/bar_bar_method_helloworld.go | 21 +- .../workflow/bar_bar_method_listandenum.go | 17 +- .../bar/workflow/bar_bar_method_missingarg.go | 17 +- .../bar/workflow/bar_bar_method_norequest.go | 17 +- .../bar/workflow/bar_bar_method_normal.go | 17 +- .../workflow/bar_bar_method_toomanyargs.go | 21 +- .../baz/baz_simpleservice_method_call.go | 3 - .../baz/baz_simpleservice_method_compare.go | 3 - .../baz_simpleservice_method_getprofile.go | 3 - .../baz_simpleservice_method_headerschema.go | 3 - .../baz/baz_simpleservice_method_ping.go | 3 - .../baz/baz_simpleservice_method_sillynoop.go | 3 - .../baz/baz_simpleservice_method_trans.go | 3 - .../baz_simpleservice_method_transheaders.go | 3 - ..._simpleservice_method_transheadersnoreq.go | 3 - ...z_simpleservice_method_transheaderstype.go | 3 - .../workflow/baz_simpleservice_method_call.go | 17 +- .../baz_simpleservice_method_compare.go | 21 +- .../baz_simpleservice_method_getprofile.go | 17 +- .../baz_simpleservice_method_headerschema.go | 21 +- .../workflow/baz_simpleservice_method_ping.go | 13 +- .../baz_simpleservice_method_sillynoop.go | 21 +- .../baz_simpleservice_method_trans.go | 21 +- .../baz_simpleservice_method_transheaders.go | 21 +- ..._simpleservice_method_transheadersnoreq.go | 17 +- ...z_simpleservice_method_transheaderstype.go | 21 +- .../clientless_clientless_method_beta.go | 3 - ...entless_method_clientlessargwithheaders.go | 3 - ...lientless_method_emptyclientlessrequest.go | 3 - .../contacts_contacts_method_savecontacts.go | 3 - ...oglenow_googlenow_method_addcredentials.go | 3 - ...lenow_googlenow_method_checkcredentials.go | 3 - ...oglenow_googlenow_method_addcredentials.go | 13 +- ...lenow_googlenow_method_checkcredentials.go | 13 +- .../multi/multi_serviceafront_method_hello.go | 3 - .../multi/multi_servicebfront_method_hello.go | 3 - .../multi_serviceafront_method_hello.go | 13 +- .../multi_servicebfront_method_hello.go | 13 +- .../panic/panic_servicecfront_method_hello.go | 3 - ...hexceptions_withexceptions_method_func1.go | 3 - ...hexceptions_withexceptions_method_func1.go | 21 +- 70 files changed, 236 insertions(+), 631 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index bea6108d2..8926eb5d5 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -641,10 +641,7 @@ func (h *{{$handlerName}}) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } - {{if eq (len .Exceptions) 0 -}} + {{- if eq (len .Exceptions) 0 -}} res.SendError(500, "Unexpected server error", err) return ctx {{ else }} @@ -705,7 +702,7 @@ func endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "endpoint.tmpl", size: 8032, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "endpoint.tmpl", size: 7963, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3783,7 +3780,6 @@ func {{$exportName}}(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -3884,7 +3880,6 @@ type {{$clientName}} struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } {{range $svc := .Services}} @@ -3941,14 +3936,12 @@ type {{$clientName}} struct { err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { {{range .Exceptions -}} case result.{{title .Name}} != nil: - err = c.errorBuilder.Error(result.{{title .Name}}, zanzibar.ClientException) + err = result.{{title .Name}} {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -3957,7 +3950,6 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -3974,7 +3966,6 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -3995,7 +3986,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16115, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client.tmpl", size: 15721, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4512,7 +4503,6 @@ func New{{$workflowInterface}}(deps *module.Dependencies) {{$workflowInterface}} Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("{{$instance.ClassName}}", "{{$instance.InstanceName}}"), } } @@ -4522,7 +4512,6 @@ type {{$workflowStruct}} struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -4647,33 +4636,34 @@ func (w {{$workflowStruct}}) Handle( {{- $responseType := .ResponseType }} if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { {{range $idx, $cException := $clientExceptions}} case *{{$cException.Type}}: - err = convert{{$methodName}}{{title $cException.Name}}( + serverErr := convert{{$methodName}}{{title $cException.Name}}( errValue, ) + {{if eq $responseType ""}} + return ctx, nil, serverErr + {{else if eq $responseType "string" }} + return ctx, "", nil, serverErr + {{else}} + return ctx, nil, nil, serverErr + {{end}} {{end}} default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "{{$clientName}}"), ) + + {{if eq $responseType ""}} + return ctx, nil, err + {{else if eq $responseType "string" }} + return ctx, "", nil, err + {{else}} + return ctx, nil, nil, err + {{end}} } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - {{if eq $responseType "" -}} - return ctx, nil, err - {{else if eq $responseType "string" -}} - return ctx, "", nil, err - {{else -}} - return ctx, nil, nil, err - {{- end -}} } // Filter and map response headers from client to server response. @@ -4748,7 +4738,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10526, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10598, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/baz/baz.go b/examples/example-gateway/build/clients/baz/baz.go index 987339520..5633c8c74 100644 --- a/examples/example-gateway/build/clients/baz/baz.go +++ b/examples/example-gateway/build/clients/baz/baz.go @@ -387,7 +387,6 @@ func NewClient(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("client", "baz"), } } @@ -488,7 +487,6 @@ type bazClient struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // EchoBinary is a client RPC call for method "SecondService::echoBinary" @@ -533,9 +531,7 @@ func (c *bazClient) EchoBinary( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -543,7 +539,6 @@ func (c *bazClient) EchoBinary( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBinary") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -553,7 +548,6 @@ func (c *bazClient) EchoBinary( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBinary_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -601,9 +595,7 @@ func (c *bazClient) EchoBool( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -611,7 +603,6 @@ func (c *bazClient) EchoBool( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBool") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -621,7 +612,6 @@ func (c *bazClient) EchoBool( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBool_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -669,9 +659,7 @@ func (c *bazClient) EchoDouble( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -679,7 +667,6 @@ func (c *bazClient) EchoDouble( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoDouble") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -689,7 +676,6 @@ func (c *bazClient) EchoDouble( resp, err = clientsIDlClientsBazBaz.SecondService_EchoDouble_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -737,9 +723,7 @@ func (c *bazClient) EchoEnum( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -747,7 +731,6 @@ func (c *bazClient) EchoEnum( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoEnum") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -757,7 +740,6 @@ func (c *bazClient) EchoEnum( resp, err = clientsIDlClientsBazBaz.SecondService_EchoEnum_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -805,9 +787,7 @@ func (c *bazClient) EchoI16( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -815,7 +795,6 @@ func (c *bazClient) EchoI16( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI16") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -825,7 +804,6 @@ func (c *bazClient) EchoI16( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI16_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -873,9 +851,7 @@ func (c *bazClient) EchoI32( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -883,7 +859,6 @@ func (c *bazClient) EchoI32( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI32") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -893,7 +868,6 @@ func (c *bazClient) EchoI32( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI32_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -941,9 +915,7 @@ func (c *bazClient) EchoI64( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -951,7 +923,6 @@ func (c *bazClient) EchoI64( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI64") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -961,7 +932,6 @@ func (c *bazClient) EchoI64( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI64_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1009,9 +979,7 @@ func (c *bazClient) EchoI8( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1019,7 +987,6 @@ func (c *bazClient) EchoI8( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI8") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1029,7 +996,6 @@ func (c *bazClient) EchoI8( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI8_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1077,9 +1043,7 @@ func (c *bazClient) EchoString( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1087,7 +1051,6 @@ func (c *bazClient) EchoString( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoString") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1097,7 +1060,6 @@ func (c *bazClient) EchoString( resp, err = clientsIDlClientsBazBaz.SecondService_EchoString_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1145,9 +1107,7 @@ func (c *bazClient) EchoStringList( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1155,7 +1115,6 @@ func (c *bazClient) EchoStringList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringList") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1165,7 +1124,6 @@ func (c *bazClient) EchoStringList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringList_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1213,9 +1171,7 @@ func (c *bazClient) EchoStringMap( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1223,7 +1179,6 @@ func (c *bazClient) EchoStringMap( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringMap") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1233,7 +1188,6 @@ func (c *bazClient) EchoStringMap( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringMap_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1281,9 +1235,7 @@ func (c *bazClient) EchoStringSet( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1291,7 +1243,6 @@ func (c *bazClient) EchoStringSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringSet") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1301,7 +1252,6 @@ func (c *bazClient) EchoStringSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringSet_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1349,9 +1299,7 @@ func (c *bazClient) EchoStructList( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1359,7 +1307,6 @@ func (c *bazClient) EchoStructList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructList") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1369,7 +1316,6 @@ func (c *bazClient) EchoStructList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructList_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1417,9 +1363,7 @@ func (c *bazClient) EchoStructSet( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1427,7 +1371,6 @@ func (c *bazClient) EchoStructSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructSet") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1437,7 +1380,6 @@ func (c *bazClient) EchoStructSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructSet_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1485,9 +1427,7 @@ func (c *bazClient) EchoTypedef( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1495,7 +1435,6 @@ func (c *bazClient) EchoTypedef( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoTypedef") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1505,7 +1444,6 @@ func (c *bazClient) EchoTypedef( resp, err = clientsIDlClientsBazBaz.SecondService_EchoTypedef_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1552,16 +1490,13 @@ func (c *bazClient) Call( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr default: err = errors.New("bazClient received no result or unknown exception for Call") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1614,21 +1549,18 @@ func (c *bazClient) Compare( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr case result.OtherAuthErr != nil: - err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) + err = result.OtherAuthErr case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Compare. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for Compare") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1638,7 +1570,6 @@ func (c *bazClient) Compare( resp, err = clientsIDlClientsBazBaz.SimpleService_Compare_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1686,19 +1617,16 @@ func (c *bazClient) GetProfile( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for GetProfile") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1708,7 +1636,6 @@ func (c *bazClient) GetProfile( resp, err = clientsIDlClientsBazBaz.SimpleService_GetProfile_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1756,21 +1683,18 @@ func (c *bazClient) HeaderSchema( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr case result.OtherAuthErr != nil: - err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) + err = result.OtherAuthErr case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for HeaderSchema") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1780,7 +1704,6 @@ func (c *bazClient) HeaderSchema( resp, err = clientsIDlClientsBazBaz.SimpleService_HeaderSchema_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1828,9 +1751,7 @@ func (c *bazClient) Ping( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -1838,7 +1759,6 @@ func (c *bazClient) Ping( success = true default: err = errors.New("bazClient received no result or unknown exception for Ping") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1848,7 +1768,6 @@ func (c *bazClient) Ping( resp, err = clientsIDlClientsBazBaz.SimpleService_Ping_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -1895,18 +1814,15 @@ func (c *bazClient) DeliberateDiffNoop( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr case result.ServerErr != nil: - err = c.errorBuilder.Error(result.ServerErr, zanzibar.ClientException) + err = result.ServerErr default: err = errors.New("bazClient received no result or unknown exception for SillyNoop") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -1958,14 +1874,11 @@ func (c *bazClient) TestUUID( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { default: err = errors.New("bazClient received no result or unknown exception for TestUuid") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2018,21 +1931,18 @@ func (c *bazClient) Trans( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr case result.OtherAuthErr != nil: - err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) + err = result.OtherAuthErr case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Trans. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for Trans") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2042,7 +1952,6 @@ func (c *bazClient) Trans( resp, err = clientsIDlClientsBazBaz.SimpleService_Trans_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2090,21 +1999,18 @@ func (c *bazClient) TransHeaders( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr case result.OtherAuthErr != nil: - err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) + err = result.OtherAuthErr case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeaders") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2114,7 +2020,6 @@ func (c *bazClient) TransHeaders( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeaders_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2162,19 +2067,16 @@ func (c *bazClient) TransHeadersNoReq( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersNoReq") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2184,7 +2086,6 @@ func (c *bazClient) TransHeadersNoReq( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersNoReq_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2232,21 +2133,18 @@ func (c *bazClient) TransHeadersType( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.AuthErr != nil: - err = c.errorBuilder.Error(result.AuthErr, zanzibar.ClientException) + err = result.AuthErr case result.OtherAuthErr != nil: - err = c.errorBuilder.Error(result.OtherAuthErr, zanzibar.ClientException) + err = result.OtherAuthErr case result.Success != nil: ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding", zap.Error(err)) success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersType") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -2256,7 +2154,6 @@ func (c *bazClient) TransHeadersType( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersType_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err @@ -2303,14 +2200,11 @@ func (c *bazClient) URLTest( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { default: err = errors.New("bazClient received no result or unknown exception for UrlTest") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { diff --git a/examples/example-gateway/build/clients/corge/corge.go b/examples/example-gateway/build/clients/corge/corge.go index f91767440..5c16a9986 100644 --- a/examples/example-gateway/build/clients/corge/corge.go +++ b/examples/example-gateway/build/clients/corge/corge.go @@ -206,7 +206,6 @@ func NewClient(deps *module.Dependencies) Client { client: client, circuitBreakerDisabled: circuitBreakerDisabled, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("client", "corge"), } } @@ -307,7 +306,6 @@ type corgeClient struct { client *zanzibar.TChannelClient circuitBreakerDisabled bool defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // EchoString is a client RPC call for method "Corge::echoString" @@ -352,9 +350,7 @@ func (c *corgeClient) EchoString( err = clientErr } } - if err != nil { - err = c.errorBuilder.Error(err, zanzibar.TChannelError) - } + if err == nil && !success { switch { case result.Success != nil: @@ -362,7 +358,6 @@ func (c *corgeClient) EchoString( success = true default: err = errors.New("corgeClient received no result or unknown exception for EchoString") - err = c.errorBuilder.Error(err, zanzibar.BadResponse) } } if err != nil { @@ -372,7 +367,6 @@ func (c *corgeClient) EchoString( resp, err = clientsIDlClientsCorgeCorge.Corge_EchoString_Helper.UnwrapResponse(&result) if err != nil { - err = c.errorBuilder.Error(err, zanzibar.ClientException) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) } return ctx, resp, respHeaders, err diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go index 8cdf41e5b..855c09001 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go @@ -142,9 +142,6 @@ func (h *BarArgNotStructHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go index be53604e8..d273b2656 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go @@ -173,9 +173,6 @@ func (h *BarArgWithHeadersHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go index bd7010235..e94ce9494 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go @@ -476,9 +476,6 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go index 659197ee7..584383952 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go @@ -199,9 +199,6 @@ func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go index afd35f2c2..d3fc928a5 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go @@ -255,9 +255,6 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go index be5d09bb9..0995c7f78 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go @@ -170,9 +170,6 @@ func (h *BarArgWithParamsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go index 9b59292f6..40770cde2 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go @@ -166,9 +166,6 @@ func (h *BarArgWithParamsAndDuplicateFieldsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go index 8bdb04f8f..24a31a683 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go @@ -167,9 +167,6 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go index 631aa1217..2776ae988 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go @@ -200,9 +200,6 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go index bd2c46e31..e775dc4f6 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go @@ -142,9 +142,6 @@ func (h *BarDeleteWithBodyHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go index 630cb8a5c..62fe2c6ed 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go @@ -136,9 +136,6 @@ func (h *BarHelloWorldHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go index 84f8eaa17..d1afeb485 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go @@ -206,9 +206,6 @@ func (h *BarListAndEnumHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go index b0481eb7d..fc72eac8f 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go @@ -135,9 +135,6 @@ func (h *BarMissingArgHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go index 21f06d638..66b993bb8 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go @@ -135,9 +135,6 @@ func (h *BarNoRequestHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go index a66bd2321..619fccae3 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go @@ -171,9 +171,6 @@ func (h *BarNormalHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go index 04694bfa2..34eff269c 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go @@ -165,9 +165,6 @@ func (h *BarTooManyArgsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go index 7d1c11b3e..7812ae8d0 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argnotstruct.go @@ -63,7 +63,6 @@ func NewBarArgNotStructWorkflow(deps *module.Dependencies) BarArgNotStructWorkfl Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgNotStructWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,27 +130,24 @@ func (w barArgNotStructWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - err = convertArgNotStructBarException( + serverErr := convertArgNotStructBarException( errValue, ) + return ctx, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go index fd804e948..36ccbc735 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithheaders.go @@ -63,7 +63,6 @@ func NewBarArgWithHeadersWorkflow(deps *module.Dependencies) BarArgWithHeadersWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgWithHeadersWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -136,10 +134,6 @@ func (w barArgWithHeadersWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -147,11 +141,10 @@ func (w barArgWithHeadersWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go index d52512390..77c414f32 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithmanyqueryparams.go @@ -63,7 +63,6 @@ func NewBarArgWithManyQueryParamsWorkflow(deps *module.Dependencies) BarArgWithM Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgWithManyQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,10 +130,6 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -143,11 +137,10 @@ func (w barArgWithManyQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go index 9c8cd4d22..e2a98a4c8 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go @@ -63,7 +63,6 @@ func NewBarArgWithNearDupQueryParamsWorkflow(deps *module.Dependencies) BarArgWi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgWithNearDupQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,10 +130,6 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -143,11 +137,10 @@ func (w barArgWithNearDupQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go index 29297c079..c4734cd53 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithnestedqueryparams.go @@ -63,7 +63,6 @@ func NewBarArgWithNestedQueryParamsWorkflow(deps *module.Dependencies) BarArgWit Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgWithNestedQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,10 +130,6 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -143,11 +137,10 @@ func (w barArgWithNestedQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go index 5cf5fa521..b6a9b6b4c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparams.go @@ -63,7 +63,6 @@ func NewBarArgWithParamsWorkflow(deps *module.Dependencies) BarArgWithParamsWork Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgWithParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,10 +130,6 @@ func (w barArgWithParamsWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -143,11 +137,10 @@ func (w barArgWithParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go index ac2b4ea24..4ef022d94 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithparamsandduplicatefields.go @@ -63,7 +63,6 @@ func NewBarArgWithParamsAndDuplicateFieldsWorkflow(deps *module.Dependencies) Ba Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgWithParamsAndDuplicateFieldsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,10 +130,6 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -143,11 +137,10 @@ func (w barArgWithParamsAndDuplicateFieldsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go index 5fdce11e9..bf13ff19c 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryheader.go @@ -63,7 +63,6 @@ func NewBarArgWithQueryHeaderWorkflow(deps *module.Dependencies) BarArgWithQuery Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgWithQueryHeaderWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,10 +130,6 @@ func (w barArgWithQueryHeaderWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -143,11 +137,10 @@ func (w barArgWithQueryHeaderWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go index 64458618c..b087eeaa9 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithqueryparams.go @@ -63,7 +63,6 @@ func NewBarArgWithQueryParamsWorkflow(deps *module.Dependencies) BarArgWithQuery Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barArgWithQueryParamsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -140,10 +138,6 @@ func (w barArgWithQueryParamsWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -151,11 +145,10 @@ func (w barArgWithQueryParamsWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go index 98e77ba16..9752a7354 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_deletewithbody.go @@ -63,7 +63,6 @@ func NewBarDeleteWithBodyWorkflow(deps *module.Dependencies) BarDeleteWithBodyWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barDeleteWithBodyWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,10 +130,6 @@ func (w barDeleteWithBodyWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -143,11 +137,10 @@ func (w barDeleteWithBodyWorkflow) Handle( zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go index 5ec0f4375..c088df026 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_helloworld.go @@ -62,7 +62,6 @@ func NewBarHelloWorldWorkflow(deps *module.Dependencies) BarHelloWorldWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,7 +71,6 @@ type barHelloWorldWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,32 +127,31 @@ func (w barHelloWorldWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - err = convertHelloWorldBarException( + serverErr := convertHelloWorldBarException( errValue, ) + return ctx, "", nil, serverErr + case *clientsIDlClientsBarBar.SeeOthersRedirection: - err = convertHelloWorldSeeOthersRedirection( + serverErr := convertHelloWorldSeeOthersRedirection( errValue, ) + return ctx, "", nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, "", nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, "", nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go index 5eb596f91..70ec1fcbe 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_listandenum.go @@ -63,7 +63,6 @@ func NewBarListAndEnumWorkflow(deps *module.Dependencies) BarListAndEnumWorkflow Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barListAndEnumWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,27 +130,24 @@ func (w barListAndEnumWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - err = convertListAndEnumBarException( + serverErr := convertListAndEnumBarException( errValue, ) + return ctx, "", nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, "", nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, "", nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go index cd6c6a99d..a3a4f6b50 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_missingarg.go @@ -62,7 +62,6 @@ func NewBarMissingArgWorkflow(deps *module.Dependencies) BarMissingArgWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,7 +71,6 @@ type barMissingArgWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,27 +127,24 @@ func (w barMissingArgWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - err = convertMissingArgBarException( + serverErr := convertMissingArgBarException( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go index ce5c95bdb..25404a7c8 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_norequest.go @@ -62,7 +62,6 @@ func NewBarNoRequestWorkflow(deps *module.Dependencies) BarNoRequestWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -72,7 +71,6 @@ type barNoRequestWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,27 +127,24 @@ func (w barNoRequestWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - err = convertNoRequestBarException( + serverErr := convertNoRequestBarException( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go index 570d90bc1..6758537f0 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_normal.go @@ -63,7 +63,6 @@ func NewBarNormalWorkflow(deps *module.Dependencies) BarNormalWorkflow { Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -73,7 +72,6 @@ type barNormalWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,27 +130,24 @@ func (w barNormalWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - err = convertNormalBarException( + serverErr := convertNormalBarException( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go index 792870f9f..41bcffec6 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_toomanyargs.go @@ -66,7 +66,6 @@ func NewBarTooManyArgsWorkflow(deps *module.Dependencies) BarTooManyArgsWorkflow Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "bar"), } } @@ -76,7 +75,6 @@ type barTooManyArgsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -143,32 +141,31 @@ func (w barTooManyArgsWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBarBar.BarException: - err = convertTooManyArgsBarException( + serverErr := convertTooManyArgsBarException( errValue, ) + return ctx, nil, nil, serverErr + case *clientsIDlClientsFooFoo.FooException: - err = convertTooManyArgsFooException( + serverErr := convertTooManyArgsFooException( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Bar"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go index 42ec6b084..3d0e9cdcb 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go @@ -157,9 +157,6 @@ func (h *SimpleServiceCallHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go index 853f4f76e..db84a6945 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go @@ -164,9 +164,6 @@ func (h *SimpleServiceCompareHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go index 1539f345e..c78889b4b 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go @@ -164,9 +164,6 @@ func (h *SimpleServiceGetProfileHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go index 2eff4135e..f1970b89d 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go @@ -167,9 +167,6 @@ func (h *SimpleServiceHeaderSchemaHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go index 455f961eb..7e2d511d9 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go @@ -134,9 +134,6 @@ func (h *SimpleServicePingHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go index 8038f07f1..1e6608132 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go @@ -135,9 +135,6 @@ func (h *SimpleServiceSillyNoopHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go index cb6e0f008..8fb8f2ffc 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go @@ -164,9 +164,6 @@ func (h *SimpleServiceTransHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go index 6df2f9dbc..c9ebb54e6 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go @@ -164,9 +164,6 @@ func (h *SimpleServiceTransHeadersHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go index 741177811..8fcf59ddd 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go @@ -139,9 +139,6 @@ func (h *SimpleServiceTransHeadersNoReqHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go index 8f8ab06ff..6bf50bff2 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go @@ -164,9 +164,6 @@ func (h *SimpleServiceTransHeadersTypeHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go index 8d0bb0408..6da3706be 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_call.go @@ -63,7 +63,6 @@ func NewSimpleServiceCallWorkflow(deps *module.Dependencies) SimpleServiceCallWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,7 +72,6 @@ type simpleServiceCallWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -140,27 +138,24 @@ func (w simpleServiceCallWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertCallAuthErr( + serverErr := convertCallAuthErr( errValue, ) + return ctx, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go index db81c362e..9d81f5ed8 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_compare.go @@ -64,7 +64,6 @@ func NewSimpleServiceCompareWorkflow(deps *module.Dependencies) SimpleServiceCom Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -74,7 +73,6 @@ type simpleServiceCompareWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -133,32 +131,31 @@ func (w simpleServiceCompareWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertCompareAuthErr( + serverErr := convertCompareAuthErr( errValue, ) + return ctx, nil, nil, serverErr + case *clientsIDlClientsBazBaz.OtherAuthErr: - err = convertCompareOtherAuthErr( + serverErr := convertCompareOtherAuthErr( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go index e86093e2c..2bffcecc1 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_getprofile.go @@ -63,7 +63,6 @@ func NewSimpleServiceGetProfileWorkflow(deps *module.Dependencies) SimpleService Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,7 +72,6 @@ type simpleServiceGetProfileWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,27 +130,24 @@ func (w simpleServiceGetProfileWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertGetProfileAuthErr( + serverErr := convertGetProfileAuthErr( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go index b758bb9fd..570ca0ed3 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_headerschema.go @@ -63,7 +63,6 @@ func NewSimpleServiceHeaderSchemaWorkflow(deps *module.Dependencies) SimpleServi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,7 +72,6 @@ type simpleServiceHeaderSchemaWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -148,32 +146,31 @@ func (w simpleServiceHeaderSchemaWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertHeaderSchemaAuthErr( + serverErr := convertHeaderSchemaAuthErr( errValue, ) + return ctx, nil, nil, serverErr + case *clientsIDlClientsBazBaz.OtherAuthErr: - err = convertHeaderSchemaOtherAuthErr( + serverErr := convertHeaderSchemaOtherAuthErr( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go index 28c53a688..7aa626ef7 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_ping.go @@ -62,7 +62,6 @@ func NewSimpleServicePingWorkflow(deps *module.Dependencies) SimpleServicePingWo Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -72,7 +71,6 @@ type simpleServicePingWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,10 +127,6 @@ func (w simpleServicePingWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -140,11 +134,10 @@ func (w simpleServicePingWorkflow) Handle( zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go index 3fdee6c8d..af344b1c8 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_sillynoop.go @@ -63,7 +63,6 @@ func NewSimpleServiceSillyNoopWorkflow(deps *module.Dependencies) SimpleServiceS Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -73,7 +72,6 @@ type simpleServiceSillyNoopWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -128,32 +126,31 @@ func (w simpleServiceSillyNoopWorkflow) Handle( ctx, _, err := w.Clients.Baz.DeliberateDiffNoop(ctx, clientHeaders) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertSillyNoopAuthErr( + serverErr := convertSillyNoopAuthErr( errValue, ) + return ctx, nil, serverErr + case *clientsIDlClientsBazBase.ServerErr: - err = convertSillyNoopServerErr( + serverErr := convertSillyNoopServerErr( errValue, ) + return ctx, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go index 454dda6a3..8cb5a69b6 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_trans.go @@ -64,7 +64,6 @@ func NewSimpleServiceTransWorkflow(deps *module.Dependencies) SimpleServiceTrans Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -74,7 +73,6 @@ type simpleServiceTransWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -133,32 +131,31 @@ func (w simpleServiceTransWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertTransAuthErr( + serverErr := convertTransAuthErr( errValue, ) + return ctx, nil, nil, serverErr + case *clientsIDlClientsBazBaz.OtherAuthErr: - err = convertTransOtherAuthErr( + serverErr := convertTransOtherAuthErr( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go index f4bc8336d..992033573 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaders.go @@ -64,7 +64,6 @@ func NewSimpleServiceTransHeadersWorkflow(deps *module.Dependencies) SimpleServi Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -74,7 +73,6 @@ type simpleServiceTransHeadersWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -142,32 +140,31 @@ func (w simpleServiceTransHeadersWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertTransHeadersAuthErr( + serverErr := convertTransHeadersAuthErr( errValue, ) + return ctx, nil, nil, serverErr + case *clientsIDlClientsBazBaz.OtherAuthErr: - err = convertTransHeadersOtherAuthErr( + serverErr := convertTransHeadersOtherAuthErr( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go index 28d294aac..f038a6861 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheadersnoreq.go @@ -64,7 +64,6 @@ func NewSimpleServiceTransHeadersNoReqWorkflow(deps *module.Dependencies) Simple Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -74,7 +73,6 @@ type simpleServiceTransHeadersNoReqWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -144,27 +142,24 @@ func (w simpleServiceTransHeadersNoReqWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertTransHeadersNoReqAuthErr( + serverErr := convertTransHeadersNoReqAuthErr( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go index e045d93d2..4bc9b3342 100644 --- a/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/workflow/baz_simpleservice_method_transheaderstype.go @@ -64,7 +64,6 @@ func NewSimpleServiceTransHeadersTypeWorkflow(deps *module.Dependencies) SimpleS Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "baz"), } } @@ -74,7 +73,6 @@ type simpleServiceTransHeadersTypeWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -134,32 +132,31 @@ func (w simpleServiceTransHeadersTypeWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsBazBaz.AuthErr: - err = convertTransHeadersTypeAuthErr( + serverErr := convertTransHeadersTypeAuthErr( errValue, ) + return ctx, nil, nil, serverErr + case *clientsIDlClientsBazBaz.OtherAuthErr: - err = convertTransHeadersTypeOtherAuthErr( + serverErr := convertTransHeadersTypeOtherAuthErr( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Baz"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go index 8ee668432..a052eafc3 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go @@ -164,9 +164,6 @@ func (h *ClientlessBetaHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go index 10dd28de5..f434247d9 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go @@ -175,9 +175,6 @@ func (h *ClientlessClientlessArgWithHeadersHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go index f83e3d51e..63394ef53 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go @@ -149,9 +149,6 @@ func (h *ClientlessEmptyclientlessRequestHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go b/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go index 3d2b5b181..1e140d3ab 100644 --- a/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go +++ b/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go @@ -169,9 +169,6 @@ func (h *ContactsSaveContactsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch err.(type) { diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go index 969ccc526..2d79f430e 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go @@ -145,9 +145,6 @@ func (h *GoogleNowAddCredentialsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go index 55efad4d1..1f22547b0 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go @@ -138,9 +138,6 @@ func (h *GoogleNowCheckCredentialsHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go index 7ddcd7aea..debfafbb0 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_addcredentials.go @@ -63,7 +63,6 @@ func NewGoogleNowAddCredentialsWorkflow(deps *module.Dependencies) GoogleNowAddC Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "googlenow"), } } @@ -73,7 +72,6 @@ type googleNowAddCredentialsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -140,10 +138,6 @@ func (w googleNowAddCredentialsWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -151,11 +145,10 @@ func (w googleNowAddCredentialsWorkflow) Handle( zap.Error(errValue), zap.String("client", "GoogleNow"), ) + + return ctx, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go index 15083188e..9c3d26db3 100644 --- a/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/workflow/googlenow_googlenow_method_checkcredentials.go @@ -59,7 +59,6 @@ func NewGoogleNowCheckCredentialsWorkflow(deps *module.Dependencies) GoogleNowCh Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "googlenow"), } } @@ -69,7 +68,6 @@ type googleNowCheckCredentialsWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -132,10 +130,6 @@ func (w googleNowCheckCredentialsWorkflow) Handle( ctx, cliRespHeaders, err := w.Clients.GoogleNow.CheckCredentials(ctx, clientHeaders) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -143,11 +137,10 @@ func (w googleNowCheckCredentialsWorkflow) Handle( zap.Error(errValue), zap.String("client", "GoogleNow"), ) + + return ctx, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go index 9d632d4d3..a9fc12109 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go @@ -135,9 +135,6 @@ func (h *ServiceAFrontHelloHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go index c0e541e91..d598e6543 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go @@ -135,9 +135,6 @@ func (h *ServiceBFrontHelloHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go index d116ffc54..dffd383d4 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_serviceafront_method_hello.go @@ -59,7 +59,6 @@ func NewServiceAFrontHelloWorkflow(deps *module.Dependencies) ServiceAFrontHello Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "multi"), } } @@ -69,7 +68,6 @@ type serviceAFrontHelloWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -126,10 +124,6 @@ func (w serviceAFrontHelloWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -137,11 +131,10 @@ func (w serviceAFrontHelloWorkflow) Handle( zap.Error(errValue), zap.String("client", "Multi"), ) + + return ctx, "", nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, "", nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go index 9de69b584..9366d1a18 100644 --- a/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/workflow/multi_servicebfront_method_hello.go @@ -59,7 +59,6 @@ func NewServiceBFrontHelloWorkflow(deps *module.Dependencies) ServiceBFrontHello Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "multi"), } } @@ -69,7 +68,6 @@ type serviceBFrontHelloWorkflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -126,10 +124,6 @@ func (w serviceBFrontHelloWorkflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { default: @@ -137,11 +131,10 @@ func (w serviceBFrontHelloWorkflow) Handle( zap.Error(errValue), zap.String("client", "Multi"), ) + + return ctx, "", nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, "", nil, err } // Filter and map response headers from client to server response. diff --git a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go index 4cd7be1e3..31f2268e1 100644 --- a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go @@ -135,9 +135,6 @@ func (h *ServiceCFrontHelloHandler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } res.SendError(500, "Unexpected server error", err) return ctx diff --git a/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go index 81111d606..329ec6c5b 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go @@ -135,9 +135,6 @@ func (h *WithExceptionsFunc1Handler) HandleRequest( } if err != nil { - if zErr, ok := err.(zanzibar.Error); ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { diff --git a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go index 9fbaf6fa6..9fe3d29e3 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/workflow/withexceptions_withexceptions_method_func1.go @@ -62,7 +62,6 @@ func NewWithExceptionsFunc1Workflow(deps *module.Dependencies) WithExceptionsFun Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, defaultDeps: deps.Default, - errorBuilder: zanzibar.NewErrorBuilder("endpoint", "withexceptions"), } } @@ -72,7 +71,6 @@ type withExceptionsFunc1Workflow struct { Logger *zap.Logger whitelistedDynamicHeaders []string defaultDeps *zanzibar.DefaultDependencies - errorBuilder zanzibar.ErrorBuilder } // Handle calls thrift client. @@ -129,32 +127,31 @@ func (w withExceptionsFunc1Workflow) Handle( ) if err != nil { - zErr, ok := err.(zanzibar.Error) - if ok { - err = zErr.Unwrap() - } switch errValue := err.(type) { case *clientsIDlClientsWithexceptionsWithexceptions.ExceptionType1: - err = convertFunc1E1( + serverErr := convertFunc1E1( errValue, ) + return ctx, nil, nil, serverErr + case *clientsIDlClientsWithexceptionsWithexceptions.ExceptionType2: - err = convertFunc1E2( + serverErr := convertFunc1E2( errValue, ) + return ctx, nil, nil, serverErr + default: w.Logger.Warn("Client failure: could not make client request", zap.Error(errValue), zap.String("client", "Withexceptions"), ) + + return ctx, nil, nil, err + } - if zErr != nil { - err = w.errorBuilder.Rebuild(zErr, err) - } - return ctx, nil, nil, err } // Filter and map response headers from client to server response. From 4fd654704b079ce86fc5b4558ded072bb18062c0 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Wed, 5 Jul 2023 05:51:31 +0000 Subject: [PATCH 34/86] fix lint --- codegen/template_bundle/template_files.go | 26 +++++++++++------------ codegen/templates/workflow.tmpl | 24 ++++++++++----------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 8926eb5d5..4afe34ffd 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -4643,12 +4643,12 @@ func (w {{$workflowStruct}}) Handle( errValue, ) {{if eq $responseType ""}} - return ctx, nil, serverErr - {{else if eq $responseType "string" }} - return ctx, "", nil, serverErr - {{else}} - return ctx, nil, nil, serverErr - {{end}} + return ctx, nil, serverErr + {{else if eq $responseType "string" }} + return ctx, "", nil, serverErr + {{else}} + return ctx, nil, nil, serverErr + {{end}} {{end}} default: w.Logger.Warn("Client failure: could not make client request", @@ -4657,12 +4657,12 @@ func (w {{$workflowStruct}}) Handle( ) {{if eq $responseType ""}} - return ctx, nil, err - {{else if eq $responseType "string" }} - return ctx, "", nil, err - {{else}} - return ctx, nil, nil, err - {{end}} + return ctx, nil, err + {{else if eq $responseType "string" }} + return ctx, "", nil, err + {{else}} + return ctx, nil, nil, err + {{end}} } } @@ -4738,7 +4738,7 @@ func workflowTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "workflow.tmpl", size: 10598, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "workflow.tmpl", size: 10454, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/codegen/templates/workflow.tmpl b/codegen/templates/workflow.tmpl index 71514b2f3..accb8bffc 100644 --- a/codegen/templates/workflow.tmpl +++ b/codegen/templates/workflow.tmpl @@ -235,12 +235,12 @@ func (w {{$workflowStruct}}) Handle( errValue, ) {{if eq $responseType ""}} - return ctx, nil, serverErr - {{else if eq $responseType "string" }} - return ctx, "", nil, serverErr - {{else}} - return ctx, nil, nil, serverErr - {{end}} + return ctx, nil, serverErr + {{else if eq $responseType "string" }} + return ctx, "", nil, serverErr + {{else}} + return ctx, nil, nil, serverErr + {{end}} {{end}} default: w.Logger.Warn("Client failure: could not make client request", @@ -249,12 +249,12 @@ func (w {{$workflowStruct}}) Handle( ) {{if eq $responseType ""}} - return ctx, nil, err - {{else if eq $responseType "string" }} - return ctx, "", nil, err - {{else}} - return ctx, nil, nil, err - {{end}} + return ctx, nil, err + {{else if eq $responseType "string" }} + return ctx, "", nil, err + {{else}} + return ctx, nil, nil, err + {{end}} } } From d17b5a9fc294ac64c9bfc2d44857ceda6e718589 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Thu, 6 Jul 2023 15:43:02 +0530 Subject: [PATCH 35/86] remove duplicate logfield endpoint name --- codegen/templates/endpoint.tmpl | 11 +++-------- codegen/templates/tchannel_endpoint.tmpl | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/codegen/templates/endpoint.tmpl b/codegen/templates/endpoint.tmpl index 6ec0a9262..d2efa94dd 100644 --- a/codegen/templates/endpoint.tmpl +++ b/codegen/templates/endpoint.tmpl @@ -111,8 +111,7 @@ func (h *{{$handlerName}}) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -150,9 +149,7 @@ func (h *{{$handlerName}}) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field {{- if ne .RequestType ""}} zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) {{- end}} @@ -180,9 +177,7 @@ func (h *{{$handlerName}}) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field {{- if ne .ResponseType ""}} if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) diff --git a/codegen/templates/tchannel_endpoint.tmpl b/codegen/templates/tchannel_endpoint.tmpl index ef85b5fb3..8f9dcaebb 100644 --- a/codegen/templates/tchannel_endpoint.tmpl +++ b/codegen/templates/tchannel_endpoint.tmpl @@ -91,8 +91,7 @@ func (h *{{$handlerName}}) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false From be72cc85d4a2ed98db68d4fdd5d7cc08a20bcb91 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Thu, 6 Jul 2023 10:40:40 +0000 Subject: [PATCH 36/86] codegen --- codegen/template_bundle/template_files.go | 18 ++++++------------ .../abc_appdemoservice_method_call_tchannel.go | 3 +-- .../bar/bar_bar_method_argnotstruct.go | 7 ++----- .../bar/bar_bar_method_argwithheaders.go | 11 +++-------- .../bar_bar_method_argwithmanyqueryparams.go | 11 +++-------- ...bar_bar_method_argwithneardupqueryparams.go | 11 +++-------- .../bar_bar_method_argwithnestedqueryparams.go | 11 +++-------- .../bar/bar_bar_method_argwithparams.go | 11 +++-------- ...r_method_argwithparamsandduplicatefields.go | 11 +++-------- .../bar/bar_bar_method_argwithqueryheader.go | 11 +++-------- .../bar/bar_bar_method_argwithqueryparams.go | 11 +++-------- .../bar/bar_bar_method_deletewithbody.go | 7 ++----- .../endpoints/bar/bar_bar_method_helloworld.go | 7 ++----- .../bar/bar_bar_method_listandenum.go | 11 +++-------- .../endpoints/bar/bar_bar_method_missingarg.go | 7 ++----- .../endpoints/bar/bar_bar_method_norequest.go | 7 ++----- .../endpoints/bar/bar_bar_method_normal.go | 11 +++-------- .../bar/bar_bar_method_toomanyargs.go | 11 +++-------- .../baz/baz_simpleservice_method_call.go | 7 ++----- .../baz/baz_simpleservice_method_compare.go | 11 +++-------- .../baz/baz_simpleservice_method_getprofile.go | 11 +++-------- .../baz_simpleservice_method_headerschema.go | 11 +++-------- .../baz/baz_simpleservice_method_ping.go | 7 ++----- .../baz/baz_simpleservice_method_sillynoop.go | 7 ++----- .../baz/baz_simpleservice_method_trans.go | 11 +++-------- .../baz_simpleservice_method_transheaders.go | 11 +++-------- ...z_simpleservice_method_transheadersnoreq.go | 7 ++----- ...az_simpleservice_method_transheaderstype.go | 11 +++-------- .../bounce_bounce_method_bounce_tchannel.go | 3 +-- .../clientless_clientless_method_beta.go | 11 +++-------- ...ientless_method_clientlessargwithheaders.go | 11 +++-------- ...clientless_method_emptyclientlessrequest.go | 7 ++----- .../contacts_contacts_method_savecontacts.go | 11 +++-------- ...ooglenow_googlenow_method_addcredentials.go | 7 ++----- ...glenow_googlenow_method_checkcredentials.go | 7 ++----- .../multi/multi_serviceafront_method_hello.go | 7 ++----- .../multi/multi_servicebfront_method_hello.go | 7 ++----- .../panic/panic_servicecfront_method_hello.go | 7 ++----- .../baz_simpleservice_method_call_tchannel.go | 3 +-- .../baz_simpleservice_method_echo_tchannel.go | 3 +-- .../echo/echo_echo_method_echo_tchannel.go | 3 +-- ...impleservice_method_anothercall_tchannel.go | 3 +-- ...simpleservice_method_echostring_tchannel.go | 3 +-- ...thexceptions_withexceptions_method_func1.go | 7 ++----- .../bounce_bounce_method_bounce_tchannel.go | 3 +-- 45 files changed, 106 insertions(+), 268 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 4afe34ffd..165a0e5bb 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -535,8 +535,7 @@ func (h *{{$handlerName}}) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -574,9 +573,7 @@ func (h *{{$handlerName}}) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field {{- if ne .RequestType ""}} zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) {{- end}} @@ -604,9 +601,7 @@ func (h *{{$handlerName}}) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field {{- if ne .ResponseType ""}} if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) @@ -702,7 +697,7 @@ func endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "endpoint.tmpl", size: 7963, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "endpoint.tmpl", size: 7798, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -4203,8 +4198,7 @@ func (h *{{$handlerName}}) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false @@ -4401,7 +4395,7 @@ func tchannel_endpointTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9430, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9379, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/app/demo/endpoints/abc/abc_appdemoservice_method_call_tchannel.go b/examples/example-gateway/build/app/demo/endpoints/abc/abc_appdemoservice_method_call_tchannel.go index 5523e11fd..9cc9bc30b 100644 --- a/examples/example-gateway/build/app/demo/endpoints/abc/abc_appdemoservice_method_call_tchannel.go +++ b/examples/example-gateway/build/app/demo/endpoints/abc/abc_appdemoservice_method_call_tchannel.go @@ -83,8 +83,7 @@ func (h *AppDemoServiceCallHandler) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go index 855c09001..378c7e97d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argnotstruct.go @@ -94,8 +94,7 @@ func (h *BarArgNotStructHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -109,9 +108,7 @@ func (h *BarArgNotStructHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go index d273b2656..899cd0213 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithheaders.go @@ -96,8 +96,7 @@ func (h *BarArgWithHeadersHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -119,9 +118,7 @@ func (h *BarArgWithHeadersHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -140,9 +137,7 @@ func (h *BarArgWithHeadersHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go index e94ce9494..44633875a 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithmanyqueryparams.go @@ -96,8 +96,7 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -422,9 +421,7 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -443,9 +440,7 @@ func (h *BarArgWithManyQueryParamsHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go index 584383952..31ae7d3d0 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go @@ -96,8 +96,7 @@ func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -145,9 +144,7 @@ func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -166,9 +163,7 @@ func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go index d3fc928a5..4e3b0bbbb 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithnestedqueryparams.go @@ -96,8 +96,7 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -201,9 +200,7 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -222,9 +219,7 @@ func (h *BarArgWithNestedQueryParamsHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go index 0995c7f78..eb727f635 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparams.go @@ -95,8 +95,7 @@ func (h *BarArgWithParamsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -116,9 +115,7 @@ func (h *BarArgWithParamsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -137,9 +134,7 @@ func (h *BarArgWithParamsHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go index 40770cde2..4a8c9d882 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithparamsandduplicatefields.go @@ -95,8 +95,7 @@ func (h *BarArgWithParamsAndDuplicateFieldsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -112,9 +111,7 @@ func (h *BarArgWithParamsAndDuplicateFieldsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -133,9 +130,7 @@ func (h *BarArgWithParamsAndDuplicateFieldsHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go index 24a31a683..7dc210874 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryheader.go @@ -96,8 +96,7 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -113,9 +112,7 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -134,9 +131,7 @@ func (h *BarArgWithQueryHeaderHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go index 2776ae988..abbb1e5c0 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithqueryparams.go @@ -96,8 +96,7 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -146,9 +145,7 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -167,9 +164,7 @@ func (h *BarArgWithQueryParamsHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go index e775dc4f6..8e990d4ae 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_deletewithbody.go @@ -94,8 +94,7 @@ func (h *BarDeleteWithBodyHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -109,9 +108,7 @@ func (h *BarDeleteWithBodyHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go index 62fe2c6ed..2efa5e741 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_helloworld.go @@ -94,8 +94,7 @@ func (h *BarHelloWorldHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -104,9 +103,7 @@ func (h *BarHelloWorldHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go index d1afeb485..468fa960d 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_listandenum.go @@ -96,8 +96,7 @@ func (h *BarListAndEnumHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -152,9 +151,7 @@ func (h *BarListAndEnumHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -173,9 +170,7 @@ func (h *BarListAndEnumHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go index fc72eac8f..4194f6046 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_missingarg.go @@ -93,8 +93,7 @@ func (h *BarMissingArgHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -103,9 +102,7 @@ func (h *BarMissingArgHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go index 66b993bb8..218237e34 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_norequest.go @@ -93,8 +93,7 @@ func (h *BarNoRequestHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -103,9 +102,7 @@ func (h *BarNoRequestHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go index 619fccae3..6aa215db9 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_normal.go @@ -102,8 +102,7 @@ func (h *BarNormalHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -117,9 +116,7 @@ func (h *BarNormalHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -138,9 +135,7 @@ func (h *BarNormalHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go index 34eff269c..0a413c7a4 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_toomanyargs.go @@ -96,8 +96,7 @@ func (h *BarTooManyArgsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -111,9 +110,7 @@ func (h *BarTooManyArgsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -132,9 +129,7 @@ func (h *BarTooManyArgsHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go index 3d0e9cdcb..eb7c63b12 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_call.go @@ -95,8 +95,7 @@ func (h *SimpleServiceCallHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -124,9 +123,7 @@ func (h *SimpleServiceCallHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go index db84a6945..c0623895f 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_compare.go @@ -95,8 +95,7 @@ func (h *SimpleServiceCompareHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -110,9 +109,7 @@ func (h *SimpleServiceCompareHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -131,9 +128,7 @@ func (h *SimpleServiceCompareHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go index c78889b4b..1ee11fa3d 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_getprofile.go @@ -95,8 +95,7 @@ func (h *SimpleServiceGetProfileHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -110,9 +109,7 @@ func (h *SimpleServiceGetProfileHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -131,9 +128,7 @@ func (h *SimpleServiceGetProfileHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go index f1970b89d..052eec6fd 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_headerschema.go @@ -95,8 +95,7 @@ func (h *SimpleServiceHeaderSchemaHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -113,9 +112,7 @@ func (h *SimpleServiceHeaderSchemaHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -134,9 +131,7 @@ func (h *SimpleServiceHeaderSchemaHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go index 7e2d511d9..e98f47bf3 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_ping.go @@ -92,8 +92,7 @@ func (h *SimpleServicePingHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -102,9 +101,7 @@ func (h *SimpleServicePingHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go index 1e6608132..88d67577d 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_sillynoop.go @@ -93,8 +93,7 @@ func (h *SimpleServiceSillyNoopHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -103,9 +102,7 @@ func (h *SimpleServiceSillyNoopHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go index 8fb8f2ffc..8635f68ea 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_trans.go @@ -95,8 +95,7 @@ func (h *SimpleServiceTransHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -110,9 +109,7 @@ func (h *SimpleServiceTransHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -131,9 +128,7 @@ func (h *SimpleServiceTransHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go index c9ebb54e6..102fa438f 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaders.go @@ -95,8 +95,7 @@ func (h *SimpleServiceTransHeadersHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -110,9 +109,7 @@ func (h *SimpleServiceTransHeadersHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -131,9 +128,7 @@ func (h *SimpleServiceTransHeadersHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go index 8fcf59ddd..00faffdc4 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheadersnoreq.go @@ -93,8 +93,7 @@ func (h *SimpleServiceTransHeadersNoReqHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -107,9 +106,7 @@ func (h *SimpleServiceTransHeadersNoReqHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go index 6bf50bff2..34e3be583 100644 --- a/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go +++ b/examples/example-gateway/build/endpoints/baz/baz_simpleservice_method_transheaderstype.go @@ -95,8 +95,7 @@ func (h *SimpleServiceTransHeadersTypeHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -110,9 +109,7 @@ func (h *SimpleServiceTransHeadersTypeHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -131,9 +128,7 @@ func (h *SimpleServiceTransHeadersTypeHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/bounce/bounce_bounce_method_bounce_tchannel.go b/examples/example-gateway/build/endpoints/bounce/bounce_bounce_method_bounce_tchannel.go index dadcbd0fd..c9a2607fd 100644 --- a/examples/example-gateway/build/endpoints/bounce/bounce_bounce_method_bounce_tchannel.go +++ b/examples/example-gateway/build/endpoints/bounce/bounce_bounce_method_bounce_tchannel.go @@ -85,8 +85,7 @@ func (h *BounceBounceHandler) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go index a052eafc3..7883e1922 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_beta.go @@ -95,8 +95,7 @@ func (h *ClientlessBetaHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -110,9 +109,7 @@ func (h *ClientlessBetaHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -131,9 +128,7 @@ func (h *ClientlessBetaHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go index f434247d9..2d1b2874b 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_clientlessargwithheaders.go @@ -96,8 +96,7 @@ func (h *ClientlessClientlessArgWithHeadersHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -121,9 +120,7 @@ func (h *ClientlessClientlessArgWithHeadersHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -142,9 +139,7 @@ func (h *ClientlessClientlessArgWithHeadersHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go index 63394ef53..33e16a5b7 100644 --- a/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go +++ b/examples/example-gateway/build/endpoints/clientless/clientless_clientless_method_emptyclientlessrequest.go @@ -95,8 +95,7 @@ func (h *ClientlessEmptyclientlessRequestHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -116,9 +115,7 @@ func (h *ClientlessEmptyclientlessRequestHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { diff --git a/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go b/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go index 1e140d3ab..c58ff637e 100644 --- a/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go +++ b/examples/example-gateway/build/endpoints/contacts/contacts_contacts_method_savecontacts.go @@ -95,8 +95,7 @@ func (h *ContactsSaveContactsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -115,9 +114,7 @@ func (h *ContactsSaveContactsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { @@ -136,9 +133,7 @@ func (h *ContactsSaveContactsHandler) HandleRequest( // log downstream response to endpoint if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field if body, err := json.Marshal(response); err == nil { zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", body))) } diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go index 2d79f430e..915d500d9 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_addcredentials.go @@ -94,8 +94,7 @@ func (h *GoogleNowAddCredentialsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -112,9 +111,7 @@ func (h *GoogleNowAddCredentialsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field zfields = append(zfields, zap.String("body", fmt.Sprintf("%s", req.GetRawBody()))) for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { diff --git a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go index 1f22547b0..b18bf714e 100644 --- a/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go +++ b/examples/example-gateway/build/endpoints/googlenow/googlenow_googlenow_method_checkcredentials.go @@ -92,8 +92,7 @@ func (h *GoogleNowCheckCredentialsHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -106,9 +105,7 @@ func (h *GoogleNowCheckCredentialsHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go index a9fc12109..86b248183 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_serviceafront_method_hello.go @@ -93,8 +93,7 @@ func (h *ServiceAFrontHelloHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -103,9 +102,7 @@ func (h *ServiceAFrontHelloHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go index d598e6543..e6020310e 100644 --- a/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/multi/multi_servicebfront_method_hello.go @@ -93,8 +93,7 @@ func (h *ServiceBFrontHelloHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -103,9 +102,7 @@ func (h *ServiceBFrontHelloHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go index 31f2268e1..86d16a120 100644 --- a/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go +++ b/examples/example-gateway/build/endpoints/panic/panic_servicecfront_method_hello.go @@ -93,8 +93,7 @@ func (h *ServiceCFrontHelloHandler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -103,9 +102,7 @@ func (h *ServiceCFrontHelloHandler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_call_tchannel.go b/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_call_tchannel.go index ce6cf1737..581f806a7 100644 --- a/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_call_tchannel.go +++ b/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_call_tchannel.go @@ -92,8 +92,7 @@ func (h *SimpleServiceCallHandler) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false diff --git a/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_echo_tchannel.go b/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_echo_tchannel.go index 76d5b08ac..51cff04d9 100644 --- a/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_echo_tchannel.go +++ b/examples/example-gateway/build/endpoints/tchannel/baz/baz_simpleservice_method_echo_tchannel.go @@ -85,8 +85,7 @@ func (h *SimpleServiceEchoHandler) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false diff --git a/examples/example-gateway/build/endpoints/tchannel/echo/echo_echo_method_echo_tchannel.go b/examples/example-gateway/build/endpoints/tchannel/echo/echo_echo_method_echo_tchannel.go index 6d5108632..30ffc307e 100644 --- a/examples/example-gateway/build/endpoints/tchannel/echo/echo_echo_method_echo_tchannel.go +++ b/examples/example-gateway/build/endpoints/tchannel/echo/echo_echo_method_echo_tchannel.go @@ -85,8 +85,7 @@ func (h *EchoEchoHandler) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false diff --git a/examples/example-gateway/build/endpoints/tchannel/panic/panic_simpleservice_method_anothercall_tchannel.go b/examples/example-gateway/build/endpoints/tchannel/panic/panic_simpleservice_method_anothercall_tchannel.go index 950295c9b..63a168032 100644 --- a/examples/example-gateway/build/endpoints/tchannel/panic/panic_simpleservice_method_anothercall_tchannel.go +++ b/examples/example-gateway/build/endpoints/tchannel/panic/panic_simpleservice_method_anothercall_tchannel.go @@ -86,8 +86,7 @@ func (h *SimpleServiceAnotherCallHandler) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false diff --git a/examples/example-gateway/build/endpoints/tchannel/quux/quux_simpleservice_method_echostring_tchannel.go b/examples/example-gateway/build/endpoints/tchannel/quux/quux_simpleservice_method_echostring_tchannel.go index 9be8bcee8..3a4616394 100644 --- a/examples/example-gateway/build/endpoints/tchannel/quux/quux_simpleservice_method_echostring_tchannel.go +++ b/examples/example-gateway/build/endpoints/tchannel/quux/quux_simpleservice_method_echostring_tchannel.go @@ -85,8 +85,7 @@ func (h *SimpleServiceEchoStringHandler) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false diff --git a/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go b/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go index 329ec6c5b..3250bdf27 100644 --- a/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go +++ b/examples/example-gateway/build/endpoints/withexceptions/withexceptions_withexceptions_method_func1.go @@ -93,8 +93,7 @@ func (h *WithExceptionsFunc1Handler) HandleRequest( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointName)) + zap.String("stacktrace", stacktrace)) h.Dependencies.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) res.SendError(502, "Unexpected workflow panic, recovered at endpoint.", nil) @@ -103,9 +102,7 @@ func (h *WithExceptionsFunc1Handler) HandleRequest( // log endpoint request to downstream services if ce := h.Dependencies.Default.ContextLogger.Check(zapcore.DebugLevel, "stub"); ce != nil { - zfields := []zapcore.Field{ - zap.String("endpoint", h.endpoint.EndpointName), - } + var zfields []zapcore.Field for _, k := range req.Header.Keys() { if val, ok := req.Header.Get(k); ok { zfields = append(zfields, zap.String(k, val)) diff --git a/examples/selective-gateway/build/endpoints/bounce/bounce_bounce_method_bounce_tchannel.go b/examples/selective-gateway/build/endpoints/bounce/bounce_bounce_method_bounce_tchannel.go index 382429fbb..f0ccb2496 100644 --- a/examples/selective-gateway/build/endpoints/bounce/bounce_bounce_method_bounce_tchannel.go +++ b/examples/selective-gateway/build/endpoints/bounce/bounce_bounce_method_bounce_tchannel.go @@ -79,8 +79,7 @@ func (h *BounceBounceHandler) Handle( ctx, "Endpoint failure: endpoint panic", zap.Error(e), - zap.String("stacktrace", stacktrace), - zap.String("endpoint", h.endpoint.EndpointID)) + zap.String("stacktrace", stacktrace)) h.Deps.Default.ContextMetrics.IncCounter(ctx, zanzibar.MetricEndpointPanics, 1) isSuccessful = false From b268ee1d34927a119e788441e5acf89381441098 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Thu, 6 Jul 2023 12:39:11 +0000 Subject: [PATCH 37/86] codegen --- codegen/template_bundle/template_files.go | 18 - .../example-gateway/build/clients/baz/baz.go | 350 ------------------ .../build/clients/corge/corge.go | 14 - .../mock-service/mock_init.go | 6 +- .../services/selective-gateway/module/init.go | 6 +- 5 files changed, 6 insertions(+), 388 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index a1d7aa12c..165a0e5bb 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -3903,20 +3903,6 @@ type {{$clientName}} struct { var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if (c.circuitBreakerDisabled) { success, respHeaders, err = c.client.Call( ctx, "{{$svc.Name}}", "{{.Name}}", reqHeaders, args, &result) @@ -3995,11 +3981,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } -<<<<<<< HEAD - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16381, mode: os.FileMode(420), modTime: time.Unix(1, 0)} -======= info := bindataFileInfo{name: "tchannel_client.tmpl", size: 15721, mode: os.FileMode(420), modTime: time.Unix(1, 0)} ->>>>>>> fixlogapm2 a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/baz/baz.go b/examples/example-gateway/build/clients/baz/baz.go index 3388a31dd..5633c8c74 100644 --- a/examples/example-gateway/build/clients/baz/baz.go +++ b/examples/example-gateway/build/clients/baz/baz.go @@ -631,20 +631,6 @@ func (c *bazClient) EchoDouble( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoDouble", reqHeaders, args, &result) @@ -709,20 +695,6 @@ func (c *bazClient) EchoEnum( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoEnum", reqHeaders, args, &result) @@ -787,20 +759,6 @@ func (c *bazClient) EchoI16( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoI16", reqHeaders, args, &result) @@ -865,20 +823,6 @@ func (c *bazClient) EchoI32( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoI32", reqHeaders, args, &result) @@ -943,20 +887,6 @@ func (c *bazClient) EchoI64( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoI64", reqHeaders, args, &result) @@ -1021,20 +951,6 @@ func (c *bazClient) EchoI8( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoI8", reqHeaders, args, &result) @@ -1099,20 +1015,6 @@ func (c *bazClient) EchoString( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoString", reqHeaders, args, &result) @@ -1177,20 +1079,6 @@ func (c *bazClient) EchoStringList( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStringList", reqHeaders, args, &result) @@ -1255,20 +1143,6 @@ func (c *bazClient) EchoStringMap( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStringMap", reqHeaders, args, &result) @@ -1333,20 +1207,6 @@ func (c *bazClient) EchoStringSet( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStringSet", reqHeaders, args, &result) @@ -1411,20 +1271,6 @@ func (c *bazClient) EchoStructList( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStructList", reqHeaders, args, &result) @@ -1489,20 +1335,6 @@ func (c *bazClient) EchoStructSet( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoStructSet", reqHeaders, args, &result) @@ -1567,20 +1399,6 @@ func (c *bazClient) EchoTypedef( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SecondService", "echoTypedef", reqHeaders, args, &result) @@ -1644,20 +1462,6 @@ func (c *bazClient) Call( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "call", reqHeaders, args, &result) @@ -1717,20 +1521,6 @@ func (c *bazClient) Compare( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "compare", reqHeaders, args, &result) @@ -1799,20 +1589,6 @@ func (c *bazClient) GetProfile( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "getProfile", reqHeaders, args, &result) @@ -1879,20 +1655,6 @@ func (c *bazClient) HeaderSchema( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "headerSchema", reqHeaders, args, &result) @@ -1961,20 +1723,6 @@ func (c *bazClient) Ping( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "ping", reqHeaders, args, &result) @@ -2038,20 +1786,6 @@ func (c *bazClient) DeliberateDiffNoop( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "sillyNoop", reqHeaders, args, &result) @@ -2112,20 +1846,6 @@ func (c *bazClient) TestUUID( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "testUuid", reqHeaders, args, &result) @@ -2183,20 +1903,6 @@ func (c *bazClient) Trans( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "trans", reqHeaders, args, &result) @@ -2265,20 +1971,6 @@ func (c *bazClient) TransHeaders( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "transHeaders", reqHeaders, args, &result) @@ -2347,20 +2039,6 @@ func (c *bazClient) TransHeadersNoReq( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "transHeadersNoReq", reqHeaders, args, &result) @@ -2427,20 +2105,6 @@ func (c *bazClient) TransHeadersType( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "transHeadersType", reqHeaders, args, &result) @@ -2508,20 +2172,6 @@ func (c *bazClient) URLTest( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "SimpleService", "urlTest", reqHeaders, args, &result) diff --git a/examples/example-gateway/build/clients/corge/corge.go b/examples/example-gateway/build/clients/corge/corge.go index f0c3d583e..5c16a9986 100644 --- a/examples/example-gateway/build/clients/corge/corge.go +++ b/examples/example-gateway/build/clients/corge/corge.go @@ -322,20 +322,6 @@ func (c *corgeClient) EchoString( var success bool respHeaders := make(map[string]string) var err error -<<<<<<< HEAD - defer func() { - if err != nil { - logger.Append(ctx, zap.Error(err)) - if zErr, ok := err.(zanzibar.Error); ok { - logger.Append(ctx, - zap.String(zanzibar.LogFieldErrorLocation, zErr.ErrorLocation()), - zap.String(zanzibar.LogFieldErrorType, zErr.ErrorType().String()), - ) - } - } - }() -======= ->>>>>>> fixlogapm2 if c.circuitBreakerDisabled { success, respHeaders, err = c.client.Call( ctx, "Corge", "echoString", reqHeaders, args, &result) diff --git a/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go b/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go index d52005184..5a8aeda54 100644 --- a/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go +++ b/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go @@ -37,8 +37,8 @@ import ( // MockClientNodes contains mock client dependencies type MockClientNodes struct { - Echo *echoclientgenerated.MockClientWithFixture Mirror *mirrorclientgenerated.MockClient + Echo *echoclientgenerated.MockClientWithFixture } // InitializeDependenciesMock fully initializes all dependencies in the dep tree @@ -63,13 +63,13 @@ func InitializeDependenciesMock( } mockClientNodes := &MockClientNodes{ - Echo: echoclientgenerated.New(ctrl, fixtureechoclientgenerated.Fixture), Mirror: mirrorclientgenerated.NewMockClient(ctrl), + Echo: echoclientgenerated.New(ctrl, fixtureechoclientgenerated.Fixture), } initializedClientDependencies := &module.ClientDependenciesNodes{} tree.Client = initializedClientDependencies - initializedClientDependencies.Echo = mockClientNodes.Echo initializedClientDependencies.Mirror = mockClientNodes.Mirror + initializedClientDependencies.Echo = mockClientNodes.Echo initializedEndpointDependencies := &module.EndpointDependenciesNodes{} tree.Endpoint = initializedEndpointDependencies diff --git a/examples/selective-gateway/build/services/selective-gateway/module/init.go b/examples/selective-gateway/build/services/selective-gateway/module/init.go index 682e635de..27fa769fe 100644 --- a/examples/selective-gateway/build/services/selective-gateway/module/init.go +++ b/examples/selective-gateway/build/services/selective-gateway/module/init.go @@ -42,8 +42,8 @@ type DependenciesTree struct { // ClientDependenciesNodes contains client dependencies type ClientDependenciesNodes struct { - Echo echoclientgenerated.Client Mirror mirrorclientgenerated.Client + Echo echoclientgenerated.Client } // EndpointDependenciesNodes contains endpoint dependencies @@ -74,10 +74,10 @@ func InitializeDependencies( initializedClientDependencies := &ClientDependenciesNodes{} tree.Client = initializedClientDependencies - initializedClientDependencies.Echo = echoclientgenerated.NewClient(&echoclientmodule.Dependencies{ + initializedClientDependencies.Mirror = mirrorclientgenerated.NewClient(&mirrorclientmodule.Dependencies{ Default: initializedDefaultDependencies, }) - initializedClientDependencies.Mirror = mirrorclientgenerated.NewClient(&mirrorclientmodule.Dependencies{ + initializedClientDependencies.Echo = echoclientgenerated.NewClient(&echoclientmodule.Dependencies{ Default: initializedDefaultDependencies, }) From 5796198c74e2f80a735babf724ae0ecbbc738691 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 7 Jul 2023 12:36:27 +0530 Subject: [PATCH 38/86] replace redundant logs with a field --- runtime/client_http_request.go | 10 ++-------- runtime/context.go | 7 +------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index a3321b01b..984c5872d 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -215,7 +215,8 @@ func (req *ClientHTTPRequest) Do() (*ClientHTTPResponse, error) { if err != nil { req.ContextLogger.ErrorZ(req.ctx, fmt.Sprintf("Could not make http outbound %s.%s request", - req.ClientID, req.MethodName), zap.Error(err)) + req.ClientID, req.MethodName), zap.Error(err), + zap.Int64(fmt.Sprintf(logFieldClientAttempts, req.ClientID), retryCount)) return nil, errors.Wrapf(err, "errors while making outbound %s.%s request", req.ClientID, req.MethodName) } @@ -246,13 +247,6 @@ func (req *ClientHTTPRequest) executeDoWithRetry(ctx context.Context) (*http.Res shouldRetry = req.client.CheckRetry(ctx, req.timeoutAndRetryOptions, res, err) } - req.ContextLogger.Warn(ctx, "errors while making http outbound request", - zap.Error(err), - zap.String("clientId", req.ClientID), zap.String("methodName", req.MethodName), - zap.Int64("attempt", retryCount), - zap.Int("maxAttempts", req.timeoutAndRetryOptions.MaxAttempts), - zap.Bool("shouldRetry", shouldRetry)) - // TODO (future releases) - make retry conditional, inspect error/response and then retry // reassign body diff --git a/runtime/context.go b/runtime/context.go index 3887ea904..ec841a21d 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -65,16 +65,11 @@ const ( logFieldEndpointHandler = "endpointHandler" logFieldClientStatusCode = "client_status_code" logFieldClientRemoteAddr = "client_remote_addr" + logFieldClientAttempts = "client.%s.attempts" // client.{client-id}.attempts logFieldClientRequestHeaderPrefix = "Client-Req-Header" logFieldClientResponseHeaderPrefix = "Client-Res-Header" logFieldEndpointResponseHeaderPrefix = "Res-Header" - - // LogFieldErrorLocation is field name to log error location. - LogFieldErrorLocation = "error_location" - - // LogFieldErrorType is field name to log error type. - LogFieldErrorType = "error_type" ) const ( From 8e1718ec33e06e62c613a438af386d690b05d801 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 7 Jul 2023 17:43:21 +0530 Subject: [PATCH 39/86] merge response serialize err log to ctxlog --- runtime/server_http_response.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/runtime/server_http_response.go b/runtime/server_http_response.go index 3a52ce0de..85ae2c064 100644 --- a/runtime/server_http_response.go +++ b/runtime/server_http_response.go @@ -113,10 +113,7 @@ func (res *ServerHTTPResponse) finish(ctx context.Context) { } if !known { - res.contextLogger.Error(ctx, - "Unknown status code", - append(logFields, zap.Int("UnknownStatusCode", res.StatusCode))..., - ) + res.contextLogger.WarnZ(ctx, "Unknown status code") } else { tagged.Counter(endpointStatus).Inc(1) } @@ -223,7 +220,7 @@ func (res *ServerHTTPResponse) MarshalResponseJSON(body interface{}) []byte { bytes, err := res.jsonWrapper.Marshal(body) if err != nil { res.SendError(500, "Could not serialize json response", err) - res.contextLogger.Error(ctx, "Could not serialize json response", zap.Error(err)) + res.contextLogger.ErrorZ(ctx, "Could not serialize json response", zap.Error(err)) return nil } return bytes From cdd293c7edc25d6512944f8e0e378886fa2d33af Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Sun, 9 Jul 2023 06:47:18 +0000 Subject: [PATCH 40/86] codegen --- codegen/template_bundle/template_files.go | 6 +----- .../services/selective-gateway/mock-service/mock_init.go | 6 +++--- .../build/services/selective-gateway/module/init.go | 6 +++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 8ce265799..bb0a83440 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -4395,11 +4395,7 @@ func tchannel_endpointTmpl() (*asset, error) { return nil, err } -<<<<<<< HEAD - info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9379, mode: os.FileMode(420), modTime: time.Unix(1, 0)} -======= - info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9434, mode: os.FileMode(420), modTime: time.Unix(1, 0)} ->>>>>>> master + info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9383, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go b/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go index 5a8aeda54..d52005184 100644 --- a/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go +++ b/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go @@ -37,8 +37,8 @@ import ( // MockClientNodes contains mock client dependencies type MockClientNodes struct { - Mirror *mirrorclientgenerated.MockClient Echo *echoclientgenerated.MockClientWithFixture + Mirror *mirrorclientgenerated.MockClient } // InitializeDependenciesMock fully initializes all dependencies in the dep tree @@ -63,13 +63,13 @@ func InitializeDependenciesMock( } mockClientNodes := &MockClientNodes{ - Mirror: mirrorclientgenerated.NewMockClient(ctrl), Echo: echoclientgenerated.New(ctrl, fixtureechoclientgenerated.Fixture), + Mirror: mirrorclientgenerated.NewMockClient(ctrl), } initializedClientDependencies := &module.ClientDependenciesNodes{} tree.Client = initializedClientDependencies - initializedClientDependencies.Mirror = mockClientNodes.Mirror initializedClientDependencies.Echo = mockClientNodes.Echo + initializedClientDependencies.Mirror = mockClientNodes.Mirror initializedEndpointDependencies := &module.EndpointDependenciesNodes{} tree.Endpoint = initializedEndpointDependencies diff --git a/examples/selective-gateway/build/services/selective-gateway/module/init.go b/examples/selective-gateway/build/services/selective-gateway/module/init.go index 27fa769fe..682e635de 100644 --- a/examples/selective-gateway/build/services/selective-gateway/module/init.go +++ b/examples/selective-gateway/build/services/selective-gateway/module/init.go @@ -42,8 +42,8 @@ type DependenciesTree struct { // ClientDependenciesNodes contains client dependencies type ClientDependenciesNodes struct { - Mirror mirrorclientgenerated.Client Echo echoclientgenerated.Client + Mirror mirrorclientgenerated.Client } // EndpointDependenciesNodes contains endpoint dependencies @@ -74,10 +74,10 @@ func InitializeDependencies( initializedClientDependencies := &ClientDependenciesNodes{} tree.Client = initializedClientDependencies - initializedClientDependencies.Mirror = mirrorclientgenerated.NewClient(&mirrorclientmodule.Dependencies{ + initializedClientDependencies.Echo = echoclientgenerated.NewClient(&echoclientmodule.Dependencies{ Default: initializedDefaultDependencies, }) - initializedClientDependencies.Echo = echoclientgenerated.NewClient(&echoclientmodule.Dependencies{ + initializedClientDependencies.Mirror = mirrorclientgenerated.NewClient(&mirrorclientmodule.Dependencies{ Default: initializedDefaultDependencies, }) From 0bbebee4b9ca0183afa608e9b1a5a5de29909650 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Sun, 9 Jul 2023 23:50:03 +0530 Subject: [PATCH 41/86] add error fields in tchannel client --- codegen/templates/tchannel_client.tmpl | 9 ++++++--- runtime/context.go | 2 ++ runtime/log_util.go | 19 +++++++++++++++++++ runtime/tchannel_client.go | 2 ++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 runtime/log_util.go diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index 46441f135..a14f9ff92 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -385,18 +385,20 @@ type {{$clientName}} struct { {{range .Exceptions -}} case result.{{title .Name}} != nil: err = result.{{title .Name}} + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding") success = true {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") {{if eq .ResponseType "" -}} return ctx, respHeaders, err {{else -}} @@ -409,7 +411,8 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err {{end -}} diff --git a/runtime/context.go b/runtime/context.go index ec841a21d..30ef4ad5e 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -66,6 +66,8 @@ const ( logFieldClientStatusCode = "client_status_code" logFieldClientRemoteAddr = "client_remote_addr" logFieldClientAttempts = "client.%s.attempts" // client.{client-id}.attempts + logFieldErrorType = "error_type" + logFieldErrorLocation = "error_location" logFieldClientRequestHeaderPrefix = "Client-Req-Header" logFieldClientResponseHeaderPrefix = "Client-Res-Header" diff --git a/runtime/log_util.go b/runtime/log_util.go new file mode 100644 index 000000000..17f373f69 --- /dev/null +++ b/runtime/log_util.go @@ -0,0 +1,19 @@ +package zanzibar + +import "go.uber.org/zap" + +var ( + LogFieldErrTypeClientException = LogFieldErrorType("client_exception") + LogFieldErrTypeTChannelError = LogFieldErrorType("tchannel_error") + LogFieldErrTypeBadResponse = LogFieldErrorType("bad_response") + + LogFieldErrLocClient = LogFieldErrorLocation("client") +) + +func LogFieldErrorType(errType string) zap.Field { + return zap.String(logFieldErrorType, errType) +} + +func LogFieldErrorLocation(loc string) zap.Field { + return zap.String(logFieldErrorLocation, loc) +} diff --git a/runtime/tchannel_client.go b/runtime/tchannel_client.go index d4aae6d63..e42cfc31a 100644 --- a/runtime/tchannel_client.go +++ b/runtime/tchannel_client.go @@ -29,6 +29,7 @@ import ( "github.com/uber-go/tally" "github.com/uber/tchannel-go" "github.com/uber/zanzibar/runtime/ruleengine" + "go.uber.org/zap" netContext "golang.org/x/net/context" ) @@ -278,6 +279,7 @@ func (c *TChannelClient) call( }) if err != nil { + c.ContextLogger.Append(ctx, zap.Error(err), LogFieldErrTypeTChannelError, LogFieldErrLocClient) // Do not wrap system errors. if _, ok := err.(tchannel.SystemError); ok { return call.success, call.resHeaders, err From 1fa939ce92c1c8a6a621c8a87ba64e3ad39d57df Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Sun, 9 Jul 2023 19:02:13 +0000 Subject: [PATCH 42/86] codegen --- codegen/template_bundle/template_files.go | 11 +- .../example-gateway/build/clients/baz/baz.go | 211 ++++++++++++------ .../build/clients/corge/corge.go | 8 +- .../mock-service/mock_init.go | 6 +- .../services/selective-gateway/module/init.go | 6 +- 5 files changed, 156 insertions(+), 86 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index bb0a83440..989bbb712 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -3937,18 +3937,20 @@ type {{$clientName}} struct { {{range .Exceptions -}} case result.{{title .Name}} != nil: err = result.{{title .Name}} + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for {{title .Name}}. Overriding") success = true {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") {{if eq .ResponseType "" -}} return ctx, respHeaders, err {{else -}} @@ -3961,7 +3963,8 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err {{end -}} @@ -3981,7 +3984,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 15721, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client.tmpl", size: 15999, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/baz/baz.go b/examples/example-gateway/build/clients/baz/baz.go index 5633c8c74..66bd9f103 100644 --- a/examples/example-gateway/build/clients/baz/baz.go +++ b/examples/example-gateway/build/clients/baz/baz.go @@ -535,20 +535,22 @@ func (c *bazClient) EchoBinary( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoBinary. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoBinary. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBinary") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoBinary_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -599,20 +601,22 @@ func (c *bazClient) EchoBool( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoBool. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoBool. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBool") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoBool_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -663,20 +667,22 @@ func (c *bazClient) EchoDouble( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoDouble. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoDouble. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoDouble") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoDouble_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -727,20 +733,22 @@ func (c *bazClient) EchoEnum( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoEnum. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoEnum. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoEnum") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoEnum_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -791,20 +799,22 @@ func (c *bazClient) EchoI16( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI16. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoI16. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI16") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoI16_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -855,20 +865,22 @@ func (c *bazClient) EchoI32( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI32. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoI32. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI32") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoI32_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -919,20 +931,22 @@ func (c *bazClient) EchoI64( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI64. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoI64. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI64") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoI64_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -983,20 +997,22 @@ func (c *bazClient) EchoI8( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoI8. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoI8. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI8") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoI8_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1047,20 +1063,22 @@ func (c *bazClient) EchoString( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoString. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoString. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoString") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoString_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1111,20 +1129,22 @@ func (c *bazClient) EchoStringList( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringList. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoStringList. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringList") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringList_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1175,20 +1195,22 @@ func (c *bazClient) EchoStringMap( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringMap. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoStringMap. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringMap") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringMap_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1239,20 +1261,22 @@ func (c *bazClient) EchoStringSet( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStringSet. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoStringSet. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringSet") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringSet_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1303,20 +1327,22 @@ func (c *bazClient) EchoStructList( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStructList. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoStructList. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructList") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructList_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1367,20 +1393,22 @@ func (c *bazClient) EchoStructSet( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoStructSet. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoStructSet. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructSet") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructSet_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1431,20 +1459,22 @@ func (c *bazClient) EchoTypedef( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoTypedef. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoTypedef. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for EchoTypedef") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SecondService_EchoTypedef_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1495,12 +1525,14 @@ func (c *bazClient) Call( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) default: err = errors.New("bazClient received no result or unknown exception for Call") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, respHeaders, err } @@ -1554,23 +1586,27 @@ func (c *bazClient) Compare( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Compare. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for Compare. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Compare") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_Compare_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1622,21 +1658,24 @@ func (c *bazClient) GetProfile( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for GetProfile") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_GetProfile_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1688,23 +1727,27 @@ func (c *bazClient) HeaderSchema( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for HeaderSchema") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_HeaderSchema_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1755,20 +1798,22 @@ func (c *bazClient) Ping( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Ping. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for Ping. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Ping") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_Ping_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -1819,14 +1864,17 @@ func (c *bazClient) DeliberateDiffNoop( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.ServerErr != nil: err = result.ServerErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) default: err = errors.New("bazClient received no result or unknown exception for SillyNoop") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, respHeaders, err } @@ -1879,10 +1927,11 @@ func (c *bazClient) TestUUID( switch { default: err = errors.New("bazClient received no result or unknown exception for TestUuid") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, respHeaders, err } @@ -1936,23 +1985,27 @@ func (c *bazClient) Trans( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for Trans. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for Trans. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Trans") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_Trans_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -2004,23 +2057,27 @@ func (c *bazClient) TransHeaders( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeaders") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeaders_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -2072,21 +2129,24 @@ func (c *bazClient) TransHeadersNoReq( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersNoReq") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersNoReq_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -2138,23 +2198,27 @@ func (c *bazClient) TransHeadersType( switch { case result.AuthErr != nil: err = result.AuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersType") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersType_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } @@ -2205,10 +2269,11 @@ func (c *bazClient) URLTest( switch { default: err = errors.New("bazClient received no result or unknown exception for UrlTest") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, respHeaders, err } diff --git a/examples/example-gateway/build/clients/corge/corge.go b/examples/example-gateway/build/clients/corge/corge.go index 5c16a9986..ff46e5232 100644 --- a/examples/example-gateway/build/clients/corge/corge.go +++ b/examples/example-gateway/build/clients/corge/corge.go @@ -354,20 +354,22 @@ func (c *corgeClient) EchoString( if err == nil && !success { switch { case result.Success != nil: - ctx = logger.ErrorZ(ctx, "Internal error. Success flag is not set for EchoString. Overriding", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for EchoString. Overriding") success = true default: err = errors.New("corgeClient received no result or unknown exception for EchoString") + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error", zap.Error(err)) + ctx = logger.WarnZ(ctx, "Client failure: TChannel client call returned error") return ctx, resp, respHeaders, err } resp, err = clientsIDlClientsCorgeCorge.Corge_EchoString_Helper.UnwrapResponse(&result) if err != nil { - ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response", zap.Error(err)) + logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err } diff --git a/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go b/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go index d52005184..5a8aeda54 100644 --- a/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go +++ b/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go @@ -37,8 +37,8 @@ import ( // MockClientNodes contains mock client dependencies type MockClientNodes struct { - Echo *echoclientgenerated.MockClientWithFixture Mirror *mirrorclientgenerated.MockClient + Echo *echoclientgenerated.MockClientWithFixture } // InitializeDependenciesMock fully initializes all dependencies in the dep tree @@ -63,13 +63,13 @@ func InitializeDependenciesMock( } mockClientNodes := &MockClientNodes{ - Echo: echoclientgenerated.New(ctrl, fixtureechoclientgenerated.Fixture), Mirror: mirrorclientgenerated.NewMockClient(ctrl), + Echo: echoclientgenerated.New(ctrl, fixtureechoclientgenerated.Fixture), } initializedClientDependencies := &module.ClientDependenciesNodes{} tree.Client = initializedClientDependencies - initializedClientDependencies.Echo = mockClientNodes.Echo initializedClientDependencies.Mirror = mockClientNodes.Mirror + initializedClientDependencies.Echo = mockClientNodes.Echo initializedEndpointDependencies := &module.EndpointDependenciesNodes{} tree.Endpoint = initializedEndpointDependencies diff --git a/examples/selective-gateway/build/services/selective-gateway/module/init.go b/examples/selective-gateway/build/services/selective-gateway/module/init.go index 682e635de..27fa769fe 100644 --- a/examples/selective-gateway/build/services/selective-gateway/module/init.go +++ b/examples/selective-gateway/build/services/selective-gateway/module/init.go @@ -42,8 +42,8 @@ type DependenciesTree struct { // ClientDependenciesNodes contains client dependencies type ClientDependenciesNodes struct { - Echo echoclientgenerated.Client Mirror mirrorclientgenerated.Client + Echo echoclientgenerated.Client } // EndpointDependenciesNodes contains endpoint dependencies @@ -74,10 +74,10 @@ func InitializeDependencies( initializedClientDependencies := &ClientDependenciesNodes{} tree.Client = initializedClientDependencies - initializedClientDependencies.Echo = echoclientgenerated.NewClient(&echoclientmodule.Dependencies{ + initializedClientDependencies.Mirror = mirrorclientgenerated.NewClient(&mirrorclientmodule.Dependencies{ Default: initializedDefaultDependencies, }) - initializedClientDependencies.Mirror = mirrorclientgenerated.NewClient(&mirrorclientmodule.Dependencies{ + initializedClientDependencies.Echo = echoclientgenerated.NewClient(&echoclientmodule.Dependencies{ Default: initializedDefaultDependencies, }) From 1392f5d9afdd005f5fee2e08802e73b629ecba42 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 10 Jul 2023 00:33:28 +0530 Subject: [PATCH 43/86] fix npe --- runtime/context.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/context.go b/runtime/context.go index 30ef4ad5e..1423b71ae 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -223,8 +223,7 @@ func (sf *safeFields) getFields() []zap.Field { } func getSafeFieldsFromContext(ctx context.Context) *safeFields { - v := ctx.Value(safeFieldsKey).(*safeFields) - if v != nil { + if v, ok := ctx.Value(safeFieldsKey).(*safeFields); ok { return v } return &safeFields{} From fcce1b61ff64207f5850c214b6b06cc68573b8d2 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 10 Jul 2023 09:02:00 +0530 Subject: [PATCH 44/86] remove append func --- runtime/context.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/runtime/context.go b/runtime/context.go index 9acc8b9c3..4eab73b6a 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -68,12 +68,6 @@ const ( logFieldClientRequestHeaderPrefix = "Client-Req-Header" logFieldClientResponseHeaderPrefix = "Client-Res-Header" logFieldEndpointResponseHeaderPrefix = "Res-Header" - - // LogFieldErrorLocation is field name to log error location. - LogFieldErrorLocation = "error_location" - - // LogFieldErrorType is field name to log error type. - LogFieldErrorType = "error_type" ) const ( @@ -391,9 +385,6 @@ type ContextLogger interface { Check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry SetSkipZanzibarLogs(bool) - - // Append appends the fields to the context. - Append(ctx context.Context, fields ...zap.Field) context.Context } // NewContextLogger returns a logger that extracts log fields a context before passing through to underlying zap logger. @@ -413,10 +404,6 @@ type contextLogger struct { skipZanzibarLogs bool } -func (c *contextLogger) Append(ctx context.Context, fields ...zap.Field) context.Context { - return WithLogFields(ctx, fields...) -} - func (c *contextLogger) Debug(ctx context.Context, msg string, userFields ...zap.Field) context.Context { c.log.Debug(msg, accumulateLogFields(ctx, userFields)...) return ctx From cb6829b68f13dd724353bf34b2bd19f593d18bb0 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Mon, 10 Jul 2023 04:11:07 +0000 Subject: [PATCH 45/86] codegen --- codegen/template_bundle/template_files.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 8ce265799..bb0a83440 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -4395,11 +4395,7 @@ func tchannel_endpointTmpl() (*asset, error) { return nil, err } -<<<<<<< HEAD - info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9379, mode: os.FileMode(420), modTime: time.Unix(1, 0)} -======= - info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9434, mode: os.FileMode(420), modTime: time.Unix(1, 0)} ->>>>>>> master + info := bindataFileInfo{name: "tchannel_endpoint.tmpl", size: 9383, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } From 4a83b3420a4a18bf5e81f4c3f405d7af6c12d9e5 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 10 Jul 2023 15:09:34 +0530 Subject: [PATCH 46/86] add bad_request error tagging --- runtime/client_http_request.go | 12 ++++++------ runtime/client_http_response.go | 15 +++++++-------- runtime/log_util.go | 1 + 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index 984c5872d..46b513348 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -116,11 +116,10 @@ func (req *ClientHTTPRequest) CheckHeaders(expected []string) error { // headerName is case insensitive, http.Header Get canonicalize the key headerValue := actualHeaders.Get(headerName) if headerValue == "" { + err := errors.New("Missing mandatory header: " + headerName) req.ContextLogger.WarnZ(req.ctx, "Got outbound request without mandatory header", - zap.String("headerName", headerName), - ) - - return errors.New("Missing mandatory header: " + headerName) + zap.Error(err), LogFieldErrTypeBadRequest, LogFieldErrLocClient) + return err } } @@ -167,7 +166,8 @@ func (req *ClientHTTPRequest) WriteBytes( } if httpErr != nil { - req.ContextLogger.ErrorZ(req.ctx, "Could not create outbound request", zap.Error(httpErr)) + req.ContextLogger.ErrorZ(req.ctx, "Could not create outbound request", zap.Error(httpErr), + LogFieldErrTypeBadRequest, LogFieldErrLocClient) return errors.Wrapf( httpErr, "Could not create outbound %s.%s request", req.ClientID, req.MethodName, @@ -215,7 +215,7 @@ func (req *ClientHTTPRequest) Do() (*ClientHTTPResponse, error) { if err != nil { req.ContextLogger.ErrorZ(req.ctx, fmt.Sprintf("Could not make http outbound %s.%s request", - req.ClientID, req.MethodName), zap.Error(err), + req.ClientID, req.MethodName), zap.Error(err), LogFieldErrLocClient, zap.Int64(fmt.Sprintf(logFieldClientAttempts, req.ClientID), retryCount)) return nil, errors.Wrapf(err, "errors while making outbound %s.%s request", req.ClientID, req.MethodName) } diff --git a/runtime/client_http_response.go b/runtime/client_http_response.go index 8b85cb9d1..e93492020 100644 --- a/runtime/client_http_response.go +++ b/runtime/client_http_response.go @@ -84,11 +84,11 @@ func (res *ClientHTTPResponse) ReadAll() ([]byte, error) { cerr := res.rawResponse.Body.Close() if cerr != nil { /* coverage ignore next line */ - res.req.ContextLogger.Error(res.req.ctx, "Could not close response body", zap.Error(cerr)) + res.req.ContextLogger.WarnZ(res.req.ctx, "Could not close response body", zap.Error(cerr), LogFieldErrLocClient) } if err != nil { - res.req.ContextLogger.ErrorZ(res.req.ctx, "Could not read response body", zap.Error(err)) + res.req.ContextLogger.ErrorZ(res.req.ctx, "Could not read response body", zap.Error(err), LogFieldErrLocClient) res.finish() return nil, errors.Wrapf( err, "Could not read %s.%s response body", @@ -120,7 +120,8 @@ func (res *ClientHTTPResponse) ReadAndUnmarshalBody(v interface{}) error { func (res *ClientHTTPResponse) UnmarshalBody(v interface{}, rawBody []byte) error { err := res.jsonWrapper.Unmarshal(rawBody, v) if err != nil { - res.req.ContextLogger.WarnZ(res.req.ctx, "Could not parse response json", zap.Error(err)) + res.req.ContextLogger.WarnZ(res.req.ctx, "Could not parse response json", zap.Error(err), + LogFieldErrTypeBadResponse, LogFieldErrLocClient) res.req.Metrics.IncCounter(res.req.ctx, clientHTTPUnmarshalError, 1) return errors.Wrapf( err, "Could not parse %s.%s response json", @@ -151,7 +152,8 @@ func (res *ClientHTTPResponse) ReadAndUnmarshalBodyMultipleOptions(vs []interfac err = fmt.Errorf("all json serialization errors: %s", merr.Error()) - res.req.ContextLogger.WarnZ(res.req.ctx, "Could not parse response json into any of provided interfaces", zap.Error(err)) + res.req.ContextLogger.WarnZ(res.req.ctx, "Could not parse response json into any of provided interfaces", + zap.Error(err), LogFieldErrTypeBadResponse, LogFieldErrLocClient) return nil, errors.Wrapf( err, "Could not parse %s.%s response json into any of provided interfaces", res.req.ClientID, res.req.MethodName, @@ -198,10 +200,7 @@ func (res *ClientHTTPResponse) finish() { _, known := knownStatusCodes[res.StatusCode] if !known { - res.req.ContextLogger.Error(res.req.ctx, - "Could not emit statusCode metric", - zap.Int("UnknownStatusCode", res.StatusCode), - ) + res.req.ContextLogger.WarnZ(res.req.ctx, "Received unknown status code from client") } else { scopeTags := map[string]string{scopeTagStatus: fmt.Sprintf("%d", res.StatusCode)} res.req.ctx = WithScopeTagsDefault(res.req.ctx, scopeTags, res.req.Metrics.Scope()) diff --git a/runtime/log_util.go b/runtime/log_util.go index 17f373f69..ea7721075 100644 --- a/runtime/log_util.go +++ b/runtime/log_util.go @@ -6,6 +6,7 @@ var ( LogFieldErrTypeClientException = LogFieldErrorType("client_exception") LogFieldErrTypeTChannelError = LogFieldErrorType("tchannel_error") LogFieldErrTypeBadResponse = LogFieldErrorType("bad_response") + LogFieldErrTypeBadRequest = LogFieldErrorType("bad_request") LogFieldErrLocClient = LogFieldErrorLocation("client") ) From c8323528b8389aa9a3842cb9479880b8d152299a Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Tue, 11 Jul 2023 17:42:45 +0530 Subject: [PATCH 47/86] replace Append method with function --- codegen/templates/tchannel_client.tmpl | 6 +++--- runtime/context.go | 6 ++---- runtime/server_http_request.go | 2 +- runtime/tchannel_client.go | 2 +- runtime/tchannel_outbound_call.go | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index a14f9ff92..baa482c0f 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -385,7 +385,7 @@ type {{$clientName}} struct { {{range .Exceptions -}} case result.{{title .Name}} != nil: err = result.{{title .Name}} - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -394,7 +394,7 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -411,7 +411,7 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err diff --git a/runtime/context.go b/runtime/context.go index 1423b71ae..be9871819 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -421,9 +421,6 @@ type ContextLogger interface { Check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry SetSkipZanzibarLogs(bool) - - // Append appends the fields to the context. - Append(ctx context.Context, fields ...zap.Field) } // NewContextLogger returns a logger that extracts log fields a context before passing through to underlying zap logger. @@ -443,7 +440,8 @@ type contextLogger struct { skipZanzibarLogs bool } -func (c *contextLogger) Append(ctx context.Context, fields ...zap.Field) { +// AppendLogFieldsToContext is safe to use concurrently. +func AppendLogFieldsToContext(ctx context.Context, fields ...zap.Field) { v := getSafeFieldsFromContext(ctx) v.append(fields) } diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index c8e56eb0e..ce637b496 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -123,7 +123,7 @@ func NewServerHTTPRequest( } ctx = WithScopeTagsDefault(ctx, scopeTags, endpoint.scope) - logger.Append(ctx, logFields...) + AppendLogFieldsToContext(ctx, logFields...) httpRequest := r.WithContext(ctx) diff --git a/runtime/tchannel_client.go b/runtime/tchannel_client.go index e42cfc31a..1c368a3f9 100644 --- a/runtime/tchannel_client.go +++ b/runtime/tchannel_client.go @@ -279,7 +279,7 @@ func (c *TChannelClient) call( }) if err != nil { - c.ContextLogger.Append(ctx, zap.Error(err), LogFieldErrTypeTChannelError, LogFieldErrLocClient) + AppendLogFieldsToContext(ctx, zap.Error(err), LogFieldErrTypeTChannelError, LogFieldErrLocClient) // Do not wrap system errors. if _, ok := err.(tchannel.SystemError); ok { return call.success, call.resHeaders, err diff --git a/runtime/tchannel_outbound_call.go b/runtime/tchannel_outbound_call.go index f2306b6b7..a665b0b8e 100644 --- a/runtime/tchannel_outbound_call.go +++ b/runtime/tchannel_outbound_call.go @@ -70,7 +70,7 @@ func (c *tchannelOutboundCall) finish(ctx context.Context, err error) { c.metrics.RecordHistogramDuration(ctx, clientLatencyHist, delta) c.duration = delta - c.contextLogger.Append(ctx, c.logFields()...) + AppendLogFieldsToContext(ctx, c.logFields()...) } func (c *tchannelOutboundCall) logFields() []zapcore.Field { From 1be36d98326c15c71d283b9bf66a12444b2bbf23 Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Tue, 11 Jul 2023 12:16:33 +0000 Subject: [PATCH 48/86] codegen --- codegen/template_bundle/template_files.go | 8 +- .../example-gateway/build/clients/baz/baz.go | 130 +++++++++--------- .../build/clients/corge/corge.go | 4 +- .../mock-service/mock_init.go | 6 +- .../services/selective-gateway/module/init.go | 6 +- 5 files changed, 77 insertions(+), 77 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 989bbb712..a81885257 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -3937,7 +3937,7 @@ type {{$clientName}} struct { {{range .Exceptions -}} case result.{{title .Name}} != nil: err = result.{{title .Name}} - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -3946,7 +3946,7 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -3963,7 +3963,7 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -3984,7 +3984,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 15999, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16059, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/baz/baz.go b/examples/example-gateway/build/clients/baz/baz.go index 66bd9f103..243d6c43b 100644 --- a/examples/example-gateway/build/clients/baz/baz.go +++ b/examples/example-gateway/build/clients/baz/baz.go @@ -539,7 +539,7 @@ func (c *bazClient) EchoBinary( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBinary") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -549,7 +549,7 @@ func (c *bazClient) EchoBinary( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBinary_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -605,7 +605,7 @@ func (c *bazClient) EchoBool( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBool") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -615,7 +615,7 @@ func (c *bazClient) EchoBool( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBool_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -671,7 +671,7 @@ func (c *bazClient) EchoDouble( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoDouble") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -681,7 +681,7 @@ func (c *bazClient) EchoDouble( resp, err = clientsIDlClientsBazBaz.SecondService_EchoDouble_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -737,7 +737,7 @@ func (c *bazClient) EchoEnum( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoEnum") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -747,7 +747,7 @@ func (c *bazClient) EchoEnum( resp, err = clientsIDlClientsBazBaz.SecondService_EchoEnum_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -803,7 +803,7 @@ func (c *bazClient) EchoI16( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI16") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -813,7 +813,7 @@ func (c *bazClient) EchoI16( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI16_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -869,7 +869,7 @@ func (c *bazClient) EchoI32( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI32") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -879,7 +879,7 @@ func (c *bazClient) EchoI32( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI32_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -935,7 +935,7 @@ func (c *bazClient) EchoI64( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI64") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -945,7 +945,7 @@ func (c *bazClient) EchoI64( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI64_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1001,7 +1001,7 @@ func (c *bazClient) EchoI8( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI8") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1011,7 +1011,7 @@ func (c *bazClient) EchoI8( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI8_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1067,7 +1067,7 @@ func (c *bazClient) EchoString( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoString") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1077,7 +1077,7 @@ func (c *bazClient) EchoString( resp, err = clientsIDlClientsBazBaz.SecondService_EchoString_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1133,7 +1133,7 @@ func (c *bazClient) EchoStringList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringList") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1143,7 +1143,7 @@ func (c *bazClient) EchoStringList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringList_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1199,7 +1199,7 @@ func (c *bazClient) EchoStringMap( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringMap") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1209,7 +1209,7 @@ func (c *bazClient) EchoStringMap( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringMap_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1265,7 +1265,7 @@ func (c *bazClient) EchoStringSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringSet") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1275,7 +1275,7 @@ func (c *bazClient) EchoStringSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringSet_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1331,7 +1331,7 @@ func (c *bazClient) EchoStructList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructList") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1341,7 +1341,7 @@ func (c *bazClient) EchoStructList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructList_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1397,7 +1397,7 @@ func (c *bazClient) EchoStructSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructSet") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1407,7 +1407,7 @@ func (c *bazClient) EchoStructSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructSet_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1463,7 +1463,7 @@ func (c *bazClient) EchoTypedef( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoTypedef") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1473,7 +1473,7 @@ func (c *bazClient) EchoTypedef( resp, err = clientsIDlClientsBazBaz.SecondService_EchoTypedef_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1525,10 +1525,10 @@ func (c *bazClient) Call( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) default: err = errors.New("bazClient received no result or unknown exception for Call") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1586,16 +1586,16 @@ func (c *bazClient) Compare( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for Compare. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Compare") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1605,7 +1605,7 @@ func (c *bazClient) Compare( resp, err = clientsIDlClientsBazBaz.SimpleService_Compare_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1658,13 +1658,13 @@ func (c *bazClient) GetProfile( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for GetProfile") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1674,7 +1674,7 @@ func (c *bazClient) GetProfile( resp, err = clientsIDlClientsBazBaz.SimpleService_GetProfile_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1727,16 +1727,16 @@ func (c *bazClient) HeaderSchema( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for HeaderSchema") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1746,7 +1746,7 @@ func (c *bazClient) HeaderSchema( resp, err = clientsIDlClientsBazBaz.SimpleService_HeaderSchema_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1802,7 +1802,7 @@ func (c *bazClient) Ping( success = true default: err = errors.New("bazClient received no result or unknown exception for Ping") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1812,7 +1812,7 @@ func (c *bazClient) Ping( resp, err = clientsIDlClientsBazBaz.SimpleService_Ping_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1864,13 +1864,13 @@ func (c *bazClient) DeliberateDiffNoop( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.ServerErr != nil: err = result.ServerErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) default: err = errors.New("bazClient received no result or unknown exception for SillyNoop") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1927,7 +1927,7 @@ func (c *bazClient) TestUUID( switch { default: err = errors.New("bazClient received no result or unknown exception for TestUuid") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -1985,16 +1985,16 @@ func (c *bazClient) Trans( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for Trans. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Trans") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -2004,7 +2004,7 @@ func (c *bazClient) Trans( resp, err = clientsIDlClientsBazBaz.SimpleService_Trans_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -2057,16 +2057,16 @@ func (c *bazClient) TransHeaders( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeaders") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -2076,7 +2076,7 @@ func (c *bazClient) TransHeaders( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeaders_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -2129,13 +2129,13 @@ func (c *bazClient) TransHeadersNoReq( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersNoReq") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -2145,7 +2145,7 @@ func (c *bazClient) TransHeadersNoReq( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersNoReq_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -2198,16 +2198,16 @@ func (c *bazClient) TransHeadersType( switch { case result.AuthErr != nil: err = result.AuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.OtherAuthErr != nil: err = result.OtherAuthErr - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersType") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -2217,7 +2217,7 @@ func (c *bazClient) TransHeadersType( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersType_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -2269,7 +2269,7 @@ func (c *bazClient) URLTest( switch { default: err = errors.New("bazClient received no result or unknown exception for UrlTest") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { diff --git a/examples/example-gateway/build/clients/corge/corge.go b/examples/example-gateway/build/clients/corge/corge.go index ff46e5232..2246539b1 100644 --- a/examples/example-gateway/build/clients/corge/corge.go +++ b/examples/example-gateway/build/clients/corge/corge.go @@ -358,7 +358,7 @@ func (c *corgeClient) EchoString( success = true default: err = errors.New("corgeClient received no result or unknown exception for EchoString") - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) } } if err != nil { @@ -368,7 +368,7 @@ func (c *corgeClient) EchoString( resp, err = clientsIDlClientsCorgeCorge.Corge_EchoString_Helper.UnwrapResponse(&result) if err != nil { - logger.Append(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err diff --git a/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go b/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go index 5a8aeda54..d52005184 100644 --- a/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go +++ b/examples/selective-gateway/build/services/selective-gateway/mock-service/mock_init.go @@ -37,8 +37,8 @@ import ( // MockClientNodes contains mock client dependencies type MockClientNodes struct { - Mirror *mirrorclientgenerated.MockClient Echo *echoclientgenerated.MockClientWithFixture + Mirror *mirrorclientgenerated.MockClient } // InitializeDependenciesMock fully initializes all dependencies in the dep tree @@ -63,13 +63,13 @@ func InitializeDependenciesMock( } mockClientNodes := &MockClientNodes{ - Mirror: mirrorclientgenerated.NewMockClient(ctrl), Echo: echoclientgenerated.New(ctrl, fixtureechoclientgenerated.Fixture), + Mirror: mirrorclientgenerated.NewMockClient(ctrl), } initializedClientDependencies := &module.ClientDependenciesNodes{} tree.Client = initializedClientDependencies - initializedClientDependencies.Mirror = mockClientNodes.Mirror initializedClientDependencies.Echo = mockClientNodes.Echo + initializedClientDependencies.Mirror = mockClientNodes.Mirror initializedEndpointDependencies := &module.EndpointDependenciesNodes{} tree.Endpoint = initializedEndpointDependencies diff --git a/examples/selective-gateway/build/services/selective-gateway/module/init.go b/examples/selective-gateway/build/services/selective-gateway/module/init.go index 27fa769fe..682e635de 100644 --- a/examples/selective-gateway/build/services/selective-gateway/module/init.go +++ b/examples/selective-gateway/build/services/selective-gateway/module/init.go @@ -42,8 +42,8 @@ type DependenciesTree struct { // ClientDependenciesNodes contains client dependencies type ClientDependenciesNodes struct { - Mirror mirrorclientgenerated.Client Echo echoclientgenerated.Client + Mirror mirrorclientgenerated.Client } // EndpointDependenciesNodes contains endpoint dependencies @@ -74,10 +74,10 @@ func InitializeDependencies( initializedClientDependencies := &ClientDependenciesNodes{} tree.Client = initializedClientDependencies - initializedClientDependencies.Mirror = mirrorclientgenerated.NewClient(&mirrorclientmodule.Dependencies{ + initializedClientDependencies.Echo = echoclientgenerated.NewClient(&echoclientmodule.Dependencies{ Default: initializedDefaultDependencies, }) - initializedClientDependencies.Echo = echoclientgenerated.NewClient(&echoclientmodule.Dependencies{ + initializedClientDependencies.Mirror = mirrorclientgenerated.NewClient(&mirrorclientmodule.Dependencies{ Default: initializedDefaultDependencies, }) From f3ace11f146d1cdcc7cae5deb4b36d1212f4a666 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 09:53:16 +0530 Subject: [PATCH 49/86] comment --- runtime/context.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/context.go b/runtime/context.go index be9871819..f0843dd1a 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -231,7 +231,7 @@ func getSafeFieldsFromContext(ctx context.Context) *safeFields { // WithLogFields returns a new context with the given log fields attached to context.Context // -// Deprecated: Use ContextLogger.Append instead. +// Deprecated: See AppendLogFieldsToContext. func WithLogFields(ctx context.Context, newFields ...zap.Field) context.Context { sf := getSafeFieldsFromContext(ctx) sf.append(newFields) @@ -440,7 +440,8 @@ type contextLogger struct { skipZanzibarLogs bool } -// AppendLogFieldsToContext is safe to use concurrently. +// AppendLogFieldsToContext is safe to use concurrently. The context should +// have safeFields value set using WithSafeLogFields before. func AppendLogFieldsToContext(ctx context.Context, fields ...zap.Field) { v := getSafeFieldsFromContext(ctx) v.append(fields) From 86d6a153060b9d35a4f102c09c56f24505931f8c Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 10:41:53 +0530 Subject: [PATCH 50/86] use safelogfields for context logging --- runtime/context.go | 55 ++++++++++++++++--- .../baz/baz_simpleservice_method_call_test.go | 3 + 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/runtime/context.go b/runtime/context.go index 0e1982cad..a727836c2 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -23,6 +23,7 @@ package zanzibar import ( "context" "strconv" + "sync" "time" "github.com/uber-go/tally" @@ -44,11 +45,11 @@ const ( routingDelegateKey = contextFieldKey("rd") shardKey = contextFieldKey("sk") endpointRequestHeader = contextFieldKey("endpointRequestHeader") - requestLogFields = contextFieldKey("requestLogFields") scopeTags = contextFieldKey("scopeTags") ctxLogCounterName = contextFieldKey("ctxLogCounter") ctxLogLevel = contextFieldKey("ctxLogLevel") ctxTimeoutRetryOptions = contextFieldKey("trOptions") + safeLogFieldsKey = contextFieldKey("safeLogFields") ) const ( @@ -98,6 +99,12 @@ type scopeData struct { scope tally.Scope // optional - may not be used by zanzibar users who use } +// safeLogFields is a log fields container that is safe to use concurrently. +type safeLogFields struct { + mu sync.Mutex + fields []zap.Field +} + // WithTimeAndRetryOptions returns a context with timeout and retry options. func WithTimeAndRetryOptions(ctx context.Context, tro *TimeoutAndRetryOptions) context.Context { return context.WithValue(ctx, ctxTimeoutRetryOptions, tro) @@ -199,20 +206,30 @@ func GetShardKeyFromCtx(ctx context.Context) string { } // WithLogFields returns a new context with the given log fields attached to context.Context +// +// Deprecated: See AppendLogFieldsToContext. func WithLogFields(ctx context.Context, newFields ...zap.Field) context.Context { - return context.WithValue(ctx, requestLogFields, accumulateLogFields(ctx, newFields)) + sf := getSafeLogFieldsFromContext(ctx) + sf.append(newFields) + return context.WithValue(ctx, safeLogFieldsKey, sf) +} + +// AppendLogFieldsToContext is safe to use concurrently. It doesn't require caller +// to update the context. The context should have safeLogFields value set using WithSafeLogFields +// (or WithLogFields for backward compatibility) before. +func AppendLogFieldsToContext(ctx context.Context, fields ...zap.Field) { + v := getSafeLogFieldsFromContext(ctx) + v.append(fields) } // GetLogFieldsFromCtx returns the log fields attached to the context.Context func GetLogFieldsFromCtx(ctx context.Context) []zap.Field { - var fields []zap.Field if ctx != nil { - v := ctx.Value(requestLogFields) - if v != nil { - fields = v.([]zap.Field) + if v, ok := ctx.Value(safeLogFieldsKey).(*safeLogFields); ok { + return v.getFields() } } - return fields + return []zap.Field{} } // WithScopeTags adds tags to context without updating the scope @@ -542,3 +559,27 @@ func GetAccumulatedLogContext(ctx context.Context, c *contextLogger, msg string, } return accumulateLogMsgAndFieldsInContext(ctx, msg, userFields, logLevel) } + +// WithSafeLogFields initiates empty safeLogFields in the context. +func WithSafeLogFields(ctx context.Context) context.Context { + return context.WithValue(ctx, safeLogFieldsKey, &safeLogFields{}) +} + +func (sf *safeLogFields) append(fields []zap.Field) { + sf.mu.Lock() + sf.fields = append(sf.fields, fields...) + sf.mu.Unlock() +} + +func (sf *safeLogFields) getFields() []zap.Field { + sf.mu.Lock() + defer sf.mu.Unlock() + return sf.fields +} + +func getSafeLogFieldsFromContext(ctx context.Context) *safeLogFields { + if v, ok := ctx.Value(safeLogFieldsKey).(*safeLogFields); ok { + return v + } + return &safeLogFields{} +} diff --git a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go index d05e2889b..19f4189e1 100644 --- a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go +++ b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go @@ -132,6 +132,9 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { "hostname", "pid", "Res-Header-client.response.duration", + zanzibar.TraceIDKey, + zanzibar.TraceSpanKey, + zanzibar.TraceSampledKey, } for _, dynamicValue := range dynamicHeaders { assert.Contains(t, logs, dynamicValue) From 82f909accf73896a099898e350c3bb1b2b9e8130 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 11:08:23 +0530 Subject: [PATCH 51/86] Refact --- test/endpoints/bar/bar_metrics_test.go | 38 ++++++++++++-------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/test/endpoints/bar/bar_metrics_test.go b/test/endpoints/bar/bar_metrics_test.go index 9325b324a..3b75ed7d1 100644 --- a/test/endpoints/bar/bar_metrics_test.go +++ b/test/endpoints/bar/bar_metrics_test.go @@ -219,32 +219,28 @@ func TestCallMetrics(t *testing.T) { delete(logMsg, dynamicValue) } expectedValues := map[string]interface{}{ - "env": "test", - "level": "debug", - "msg": "Finished an outgoing client HTTP request", - "method": "POST", - "pathname": "/bar/bar-path", - //"clientID": "bar", - //"clientMethod": "Normal", - //"clientThriftMethod": "Bar::normal", + "env": "test", + "level": "debug", + "msg": "Finished an outgoing client HTTP request", + "method": "POST", + "pathname": "/bar/bar-path", "Client-Req-Header-X-Client-Id": "bar", "Client-Req-Header-Content-Type": "application/json", "Client-Req-Header-Accept": "application/json", "Client-Res-Header-Content-Type": "text/plain; charset=utf-8", "client_status_code": float64(200), - - "zone": "unknown", - "service": "example-gateway", - "endpointID": "bar", - "endpointHandler": "normal", - "X-Uuid": "uuid", - "Regionname": "san_francisco", - "Device": "ios", - "Deviceversion": "carbon", - "Content-Length": "128", - "User-Agent": "Go-http-client/1.1", - "Accept-Encoding": "gzip", - "apienvironment": "production", + "zone": "unknown", + "service": "example-gateway", + "endpointID": "bar", + "endpointHandler": "normal", + "X-Uuid": "uuid", + "Regionname": "san_francisco", + "Device": "ios", + "Deviceversion": "carbon", + "Content-Length": "128", + "User-Agent": "Go-http-client/1.1", + "Accept-Encoding": "gzip", + "apienvironment": "production", } for actualKey, actualValue := range logMsg { assert.Equal(t, expectedValues[actualKey], actualValue, "unexpected field %q", actualKey) From 3674d108bb57a84fb043393eb2ee1025dd9d01c9 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 11:16:56 +0530 Subject: [PATCH 52/86] ut --- runtime/context_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/context_test.go b/runtime/context_test.go index 23eeb9049..b98a21dc5 100644 --- a/runtime/context_test.go +++ b/runtime/context_test.go @@ -619,3 +619,15 @@ func TestTimeoutAndRetry_NotSet(t *testing.T) { tro := GetTimeoutAndRetryOptions(context.Background()) assert.Equal(t, tro, (*TimeoutAndRetryOptions)(nil)) } + +func TestSafeLogFields(t *testing.T) { + ctx := context.Background() + ctx = WithSafeLogFields(ctx) + AppendLogFieldsToContext(ctx, zap.String("foo", "bar")) + AppendLogFieldsToContext(ctx, zap.String("hello", "world")) + fields := GetLogFieldsFromCtx(ctx) + + assert.Len(t, fields, 2) + assert.Equal(t, zap.String("foo", "bar"), fields[0]) + assert.Equal(t, zap.String("hello", "world"), fields[1]) +} \ No newline at end of file From f2bb36e7fe4ab5fcc01501f35478e5610f3745d6 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 11:34:21 +0530 Subject: [PATCH 53/86] fixlint --- runtime/context_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/context_test.go b/runtime/context_test.go index b98a21dc5..568dbedf0 100644 --- a/runtime/context_test.go +++ b/runtime/context_test.go @@ -630,4 +630,4 @@ func TestSafeLogFields(t *testing.T) { assert.Len(t, fields, 2) assert.Equal(t, zap.String("foo", "bar"), fields[0]) assert.Equal(t, zap.String("hello", "world"), fields[1]) -} \ No newline at end of file +} From 012c1fbffcdc38b02562ed6f5d616af36fffd03f Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 11:48:02 +0530 Subject: [PATCH 54/86] revert sensitive header --- runtime/constants.go | 6 ------ runtime/server_http_request.go | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/runtime/constants.go b/runtime/constants.go index 006fce296..9b4d714ec 100644 --- a/runtime/constants.go +++ b/runtime/constants.go @@ -177,9 +177,3 @@ var DefaultBackOffTimeAcrossRetries = time.Duration(DefaultBackOffTimeAcrossRetr // DefaultScaleFactor is multiplied with timeoutPerAttempt var DefaultScaleFactor = 1.1 - -// DefaultSensitiveHeaders is map of default sensitive headers that must not be logged. -// This set is in addition to the default headers declared per endpoint. See getSensitiveHeadersMap. -var DefaultSensitiveHeaders = map[string]bool{ - "utoken-caller": true, -} diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index ce637b496..833913604 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -95,10 +95,8 @@ func NewServerHTTPRequest( headers := map[string]string{} for k, v := range r.Header { - if !DefaultSensitiveHeaders[strings.ToLower(k)] { - // TODO: this 0th element logic is probably not correct - headers[k] = v[0] - } + // TODO: this 0th element logic is probably not correct + headers[k] = v[0] } ctx = WithEndpointRequestHeadersField(ctx, headers) for k, v := range endpoint.contextExtractor.ExtractScopeTags(ctx) { From 0fd60a55fa691f18ac2ed8412ce77a9069da267e Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 13:51:37 +0530 Subject: [PATCH 55/86] missingheader --- codegen/templates/http_client.tmpl | 3 +++ runtime/client_http_request.go | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index 82b31ea30..c73cb6df1 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -31,6 +31,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::{{$instance.InstanceName}}") + // Client defines {{$clientID}} client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient @@ -344,6 +346,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{if .ReqHeaders }} headerErr := req.CheckHeaders({{.ReqHeaders | printf "%#v"}}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return {{ if eq .ResponseType "" -}} ctx, nil, headerErr {{- else -}} diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index 46b513348..f929f4c3f 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -111,18 +111,17 @@ func (req *ClientHTTPRequest) CheckHeaders(expected []string) error { } actualHeaders := req.httpReq.Header - + missingHeaders := make([]string, 0) for _, headerName := range expected { // headerName is case insensitive, http.Header Get canonicalize the key headerValue := actualHeaders.Get(headerName) if headerValue == "" { - err := errors.New("Missing mandatory header: " + headerName) - req.ContextLogger.WarnZ(req.ctx, "Got outbound request without mandatory header", - zap.Error(err), LogFieldErrTypeBadRequest, LogFieldErrLocClient) - return err + missingHeaders = append(missingHeaders, headerName) } } - + if len(missingHeaders) > 0 { + return errors.New("missing mandatory headers: " + strings.Join(missingHeaders, ",")) + } return nil } From ef42fea53ff186971588201f3489a1078622c5a7 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 13:51:46 +0530 Subject: [PATCH 56/86] codegen --- codegen/template_bundle/template_files.go | 5 ++++- .../example-gateway/build/clients/bar/bar.go | 21 +++++++++++++++++++ .../build/clients/contacts/contacts.go | 2 ++ .../build/clients/corge-http/corge-http.go | 2 ++ .../build/clients/google-now/google-now.go | 5 +++++ .../build/clients/multi/multi.go | 2 ++ .../clients/withexceptions/withexceptions.go | 2 ++ 7 files changed, 38 insertions(+), 1 deletion(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 6176a0fdd..5a450f095 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -1488,6 +1488,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::{{$instance.InstanceName}}") + // Client defines {{$clientID}} client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient @@ -1801,6 +1803,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{if .ReqHeaders }} headerErr := req.CheckHeaders({{.ReqHeaders | printf "%#v"}}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return {{ if eq .ResponseType "" -}} ctx, nil, headerErr {{- else -}} @@ -2026,7 +2029,7 @@ func http_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client.tmpl", size: 19491, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client.tmpl", size: 19671, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index c07cc44ce..c3687a7c6 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -31,6 +31,7 @@ import ( "time" "github.com/afex/hystrix-go/hystrix" + "go.uber.org/zap" "github.com/pkg/errors" zanzibar "github.com/uber/zanzibar/runtime" @@ -44,6 +45,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::bar") + // Client defines bar client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient @@ -582,6 +585,7 @@ func (c *barClient) ArgWithHeaders( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -1478,6 +1482,7 @@ func (c *barClient) DeleteFoo( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, nil, headerErr } @@ -2466,6 +2471,7 @@ func (c *barClient) EchoBinary( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -2554,6 +2560,7 @@ func (c *barClient) EchoBool( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -2648,6 +2655,7 @@ func (c *barClient) EchoDouble( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -2742,6 +2750,7 @@ func (c *barClient) EchoEnum( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -2836,6 +2845,7 @@ func (c *barClient) EchoI16( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -2930,6 +2940,7 @@ func (c *barClient) EchoI32( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3024,6 +3035,7 @@ func (c *barClient) EchoI32Map( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3118,6 +3130,7 @@ func (c *barClient) EchoI64( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3212,6 +3225,7 @@ func (c *barClient) EchoI8( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3306,6 +3320,7 @@ func (c *barClient) EchoString( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3400,6 +3415,7 @@ func (c *barClient) EchoStringList( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3494,6 +3510,7 @@ func (c *barClient) EchoStringMap( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3588,6 +3605,7 @@ func (c *barClient) EchoStringSet( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3682,6 +3700,7 @@ func (c *barClient) EchoStructList( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3776,6 +3795,7 @@ func (c *barClient) EchoStructSet( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } @@ -3870,6 +3890,7 @@ func (c *barClient) EchoTypedef( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, defaultRes, nil, headerErr } diff --git a/examples/example-gateway/build/clients/contacts/contacts.go b/examples/example-gateway/build/clients/contacts/contacts.go index 1859b4055..00c344667 100644 --- a/examples/example-gateway/build/clients/contacts/contacts.go +++ b/examples/example-gateway/build/clients/contacts/contacts.go @@ -40,6 +40,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::contacts") + // Client defines contacts client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient diff --git a/examples/example-gateway/build/clients/corge-http/corge-http.go b/examples/example-gateway/build/clients/corge-http/corge-http.go index ddbc25df6..a75c33972 100644 --- a/examples/example-gateway/build/clients/corge-http/corge-http.go +++ b/examples/example-gateway/build/clients/corge-http/corge-http.go @@ -43,6 +43,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::corge-http") + // Client defines corge-http client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient diff --git a/examples/example-gateway/build/clients/google-now/google-now.go b/examples/example-gateway/build/clients/google-now/google-now.go index 397050022..d3c85568c 100644 --- a/examples/example-gateway/build/clients/google-now/google-now.go +++ b/examples/example-gateway/build/clients/google-now/google-now.go @@ -29,6 +29,7 @@ import ( "time" "github.com/afex/hystrix-go/hystrix" + "go.uber.org/zap" zanzibar "github.com/uber/zanzibar/runtime" "github.com/uber/zanzibar/runtime/jsonwrapper" @@ -40,6 +41,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::google-now") + // Client defines google-now client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient @@ -243,6 +246,7 @@ func (c *googleNowClient) AddCredentials( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, nil, headerErr } @@ -330,6 +334,7 @@ func (c *googleNowClient) CheckCredentials( headerErr := req.CheckHeaders([]string{"x-uuid"}) if headerErr != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(headerErr), logFieldErrLocation) return ctx, nil, headerErr } diff --git a/examples/example-gateway/build/clients/multi/multi.go b/examples/example-gateway/build/clients/multi/multi.go index 5f4502f3c..7af1674e6 100644 --- a/examples/example-gateway/build/clients/multi/multi.go +++ b/examples/example-gateway/build/clients/multi/multi.go @@ -39,6 +39,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::multi") + // Client defines multi client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient diff --git a/examples/example-gateway/build/clients/withexceptions/withexceptions.go b/examples/example-gateway/build/clients/withexceptions/withexceptions.go index 807945b64..b46559ebb 100644 --- a/examples/example-gateway/build/clients/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/clients/withexceptions/withexceptions.go @@ -40,6 +40,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::withexceptions") + // Client defines withexceptions client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient From 7a445a2267355c800d8bf4e9b318748370688bde Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 15:28:26 +0530 Subject: [PATCH 57/86] http outbound log --- codegen/templates/http_client.tmpl | 1 + codegen/templates/http_client_test.tmpl | 3 +++ runtime/client_http_request.go | 5 +---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index c73cb6df1..62b6a104a 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -340,6 +340,7 @@ func (c *{{$clientName}}) {{$methodName}}( err := req.WriteJSON("{{.HTTPMethod}}", fullURL, headers, nil) {{end}} {{- /* */ -}} if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return {{if eq .ResponseType ""}}ctx, nil, err{{else}}ctx, defaultRes, nil, err{{end}} } diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index 7f06662f3..ee9848de5 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -33,6 +33,8 @@ const CustomTemplateTesting = "test" // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::{{$instance.InstanceName}}") + // Client defines {{$clientID}} client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient @@ -340,6 +342,7 @@ func (c *{{$clientName}}) {{$methodName}}( err := req.WriteJSON("{{.HTTPMethod}}", fullURL, headers, nil) {{end}} {{- /* */ -}} if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return {{if eq .ResponseType ""}}ctx, nil, err{{else}}ctx, defaultRes, nil, err{{end}} } diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index f929f4c3f..3a427e1d6 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -136,9 +136,8 @@ func (req *ClientHTTPRequest) WriteJSON( var err error rawBody, err = req.jsonWrapper.Marshal(body) if err != nil { - req.ContextLogger.ErrorZ(req.ctx, "Could not serialize request json", zap.Error(err)) return errors.Wrapf( - err, "Could not serialize %s.%s request json", + err, "Could not serialize %s.%s request object", req.ClientID, req.MethodName, ) } @@ -165,8 +164,6 @@ func (req *ClientHTTPRequest) WriteBytes( } if httpErr != nil { - req.ContextLogger.ErrorZ(req.ctx, "Could not create outbound request", zap.Error(httpErr), - LogFieldErrTypeBadRequest, LogFieldErrLocClient) return errors.Wrapf( httpErr, "Could not create outbound %s.%s request", req.ClientID, req.MethodName, From 73853c16235174974e958de626bfca8a60230450 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 17:37:47 +0530 Subject: [PATCH 58/86] client_http_re --- codegen/templates/http_client.tmpl | 1 + codegen/templates/http_client_test.tmpl | 1 + runtime/client_http_request.go | 8 +------- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index 62b6a104a..91eed50c1 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -377,6 +377,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, {{if eq .ResponseType ""}}nil, err{{else}}defaultRes, nil, err{{end}} } diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index ee9848de5..bd515ed94 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -378,6 +378,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, {{if eq .ResponseType ""}}nil, err{{else}}defaultRes, nil, err{{end}} } diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index 3a427e1d6..f347be5a4 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -192,9 +192,6 @@ func (req *ClientHTTPRequest) Do() (*ClientHTTPResponse, error) { span, ctx := opentracing.StartSpanFromContext(req.ctx, opName, urlTag, methodTag) err := req.InjectSpanToHeader(span, opentracing.HTTPHeaders) if err != nil { - /* coverage ignore next line */ - req.ContextLogger.ErrorZ(req.ctx, "Fail to inject span to headers", zap.Error(err)) - /* coverage ignore next line */ return nil, err } var retryCount int64 = 1 @@ -210,9 +207,7 @@ func (req *ClientHTTPRequest) Do() (*ClientHTTPResponse, error) { span.Finish() if err != nil { - req.ContextLogger.ErrorZ(req.ctx, fmt.Sprintf("Could not make http outbound %s.%s request", - req.ClientID, req.MethodName), zap.Error(err), LogFieldErrLocClient, - zap.Int64(fmt.Sprintf(logFieldClientAttempts, req.ClientID), retryCount)) + AppendLogFieldsToContext(req.ctx, zap.Int64(fmt.Sprintf(logFieldClientAttempts, req.ClientID), retryCount)) return nil, errors.Wrapf(err, "errors while making outbound %s.%s request", req.ClientID, req.MethodName) } @@ -280,7 +275,6 @@ func (req *ClientHTTPRequest) executeDo(ctx context.Context) (*http.Response, er func (req *ClientHTTPRequest) InjectSpanToHeader(span opentracing.Span, format interface{}) error { carrier := opentracing.HTTPHeadersCarrier(req.httpReq.Header) if err := span.Tracer().Inject(span.Context(), format, carrier); err != nil { - req.ContextLogger.ErrorZ(req.ctx, "Failed to inject tracing span.", zap.Error(err)) return err } From e7fbf1f04a24a8e82eb1d5121855a9f171ede25e Mon Sep 17 00:00:00 2001 From: "amol.mejari" Date: Wed, 12 Jul 2023 12:11:23 +0000 Subject: [PATCH 59/86] codegen --- codegen/template_bundle/template_files.go | 10 ++- .../example-gateway/build/clients/bar/bar.go | 70 ++++++++++++++++++ .../build/clients/contacts/contacts.go | 5 ++ .../build/clients/corge-http/corge-http.go | 9 +++ .../build/clients/custom-bar/custom-bar.go | 73 +++++++++++++++++++ .../build/clients/google-now/google-now.go | 4 + .../build/clients/multi/multi.go | 5 ++ .../clients/withexceptions/withexceptions.go | 3 + 8 files changed, 177 insertions(+), 2 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 5a450f095..746ac9e6c 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -1797,6 +1797,7 @@ func (c *{{$clientName}}) {{$methodName}}( err := req.WriteJSON("{{.HTTPMethod}}", fullURL, headers, nil) {{end}} {{- /* */ -}} if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return {{if eq .ResponseType ""}}ctx, nil, err{{else}}ctx, defaultRes, nil, err{{end}} } @@ -1833,6 +1834,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, {{if eq .ResponseType ""}}nil, err{{else}}defaultRes, nil, err{{end}} } @@ -2029,7 +2031,7 @@ func http_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client.tmpl", size: 19671, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client.tmpl", size: 19947, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2069,6 +2071,8 @@ const CustomTemplateTesting = "test" // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::{{$instance.InstanceName}}") + // Client defines {{$clientID}} client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient @@ -2376,6 +2380,7 @@ func (c *{{$clientName}}) {{$methodName}}( err := req.WriteJSON("{{.HTTPMethod}}", fullURL, headers, nil) {{end}} {{- /* */ -}} if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return {{if eq .ResponseType ""}}ctx, nil, err{{else}}ctx, defaultRes, nil, err{{end}} } @@ -2411,6 +2416,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, {{if eq .ResponseType ""}}nil, err{{else}}defaultRes, nil, err{{end}} } @@ -2607,7 +2613,7 @@ func http_client_testTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client_test.tmpl", size: 19602, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client_test.tmpl", size: 19974, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index c3687a7c6..3e09eee18 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -475,6 +475,7 @@ func (c *barClient) ArgNotStruct( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -499,6 +500,7 @@ func (c *barClient) ArgNotStruct( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -580,6 +582,7 @@ func (c *barClient) ArgWithHeaders( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -610,6 +613,7 @@ func (c *barClient) ArgWithHeaders( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -771,6 +775,7 @@ func (c *barClient) ArgWithManyQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -795,6 +800,7 @@ func (c *barClient) ArgWithManyQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -878,6 +884,7 @@ func (c *barClient) ArgWithNearDupQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -902,6 +909,7 @@ func (c *barClient) ArgWithNearDupQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1009,6 +1017,7 @@ func (c *barClient) ArgWithNestedQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1033,6 +1042,7 @@ func (c *barClient) ArgWithNestedQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1099,6 +1109,7 @@ func (c *barClient) ArgWithParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1123,6 +1134,7 @@ func (c *barClient) ArgWithParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1189,6 +1201,7 @@ func (c *barClient) ArgWithParamsAndDuplicateFields( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1213,6 +1226,7 @@ func (c *barClient) ArgWithParamsAndDuplicateFields( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1279,6 +1293,7 @@ func (c *barClient) ArgWithQueryHeader( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1303,6 +1318,7 @@ func (c *barClient) ArgWithQueryHeader( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1386,6 +1402,7 @@ func (c *barClient) ArgWithQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1410,6 +1427,7 @@ func (c *barClient) ArgWithQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1477,6 +1495,7 @@ func (c *barClient) DeleteFoo( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1507,6 +1526,7 @@ func (c *barClient) DeleteFoo( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1565,6 +1585,7 @@ func (c *barClient) DeleteWithBody( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1589,6 +1610,7 @@ func (c *barClient) DeleteWithBody( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1656,6 +1678,7 @@ func (c *barClient) DeleteWithQueryParams( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1680,6 +1703,7 @@ func (c *barClient) DeleteWithQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1738,6 +1762,7 @@ func (c *barClient) Hello( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1762,6 +1787,7 @@ func (c *barClient) Hello( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1855,6 +1881,7 @@ func (c *barClient) ListAndEnum( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1879,6 +1906,7 @@ func (c *barClient) ListAndEnum( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1954,6 +1982,7 @@ func (c *barClient) MissingArg( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1978,6 +2007,7 @@ func (c *barClient) MissingArg( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2054,6 +2084,7 @@ func (c *barClient) NoRequest( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2078,6 +2109,7 @@ func (c *barClient) NoRequest( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2155,6 +2187,7 @@ func (c *barClient) Normal( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2179,6 +2212,7 @@ func (c *barClient) Normal( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2256,6 +2290,7 @@ func (c *barClient) NormalRecur( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2280,6 +2315,7 @@ func (c *barClient) NormalRecur( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2356,6 +2392,7 @@ func (c *barClient) TooManyArgs( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2380,6 +2417,7 @@ func (c *barClient) TooManyArgs( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2466,6 +2504,7 @@ func (c *barClient) EchoBinary( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2496,6 +2535,7 @@ func (c *barClient) EchoBinary( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2555,6 +2595,7 @@ func (c *barClient) EchoBool( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2585,6 +2626,7 @@ func (c *barClient) EchoBool( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2650,6 +2692,7 @@ func (c *barClient) EchoDouble( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2680,6 +2723,7 @@ func (c *barClient) EchoDouble( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2745,6 +2789,7 @@ func (c *barClient) EchoEnum( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2775,6 +2820,7 @@ func (c *barClient) EchoEnum( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2840,6 +2886,7 @@ func (c *barClient) EchoI16( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2870,6 +2917,7 @@ func (c *barClient) EchoI16( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2935,6 +2983,7 @@ func (c *barClient) EchoI32( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2965,6 +3014,7 @@ func (c *barClient) EchoI32( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3030,6 +3080,7 @@ func (c *barClient) EchoI32Map( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3060,6 +3111,7 @@ func (c *barClient) EchoI32Map( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3125,6 +3177,7 @@ func (c *barClient) EchoI64( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3155,6 +3208,7 @@ func (c *barClient) EchoI64( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3220,6 +3274,7 @@ func (c *barClient) EchoI8( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3250,6 +3305,7 @@ func (c *barClient) EchoI8( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3315,6 +3371,7 @@ func (c *barClient) EchoString( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3345,6 +3402,7 @@ func (c *barClient) EchoString( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3410,6 +3468,7 @@ func (c *barClient) EchoStringList( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3440,6 +3499,7 @@ func (c *barClient) EchoStringList( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3505,6 +3565,7 @@ func (c *barClient) EchoStringMap( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3535,6 +3596,7 @@ func (c *barClient) EchoStringMap( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3600,6 +3662,7 @@ func (c *barClient) EchoStringSet( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3630,6 +3693,7 @@ func (c *barClient) EchoStringSet( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3695,6 +3759,7 @@ func (c *barClient) EchoStructList( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3725,6 +3790,7 @@ func (c *barClient) EchoStructList( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3790,6 +3856,7 @@ func (c *barClient) EchoStructSet( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3820,6 +3887,7 @@ func (c *barClient) EchoStructSet( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3885,6 +3953,7 @@ func (c *barClient) EchoTypedef( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3915,6 +3984,7 @@ func (c *barClient) EchoTypedef( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/contacts/contacts.go b/examples/example-gateway/build/clients/contacts/contacts.go index 00c344667..b639d39a6 100644 --- a/examples/example-gateway/build/clients/contacts/contacts.go +++ b/examples/example-gateway/build/clients/contacts/contacts.go @@ -29,6 +29,7 @@ import ( "time" "github.com/afex/hystrix-go/hystrix" + "go.uber.org/zap" zanzibar "github.com/uber/zanzibar/runtime" "github.com/uber/zanzibar/runtime/jsonwrapper" @@ -241,6 +242,7 @@ func (c *contactsClient) SaveContacts( err := req.WriteJSON("POST", fullURL, headers, r.SaveContactsRequest) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -265,6 +267,7 @@ func (c *contactsClient) SaveContacts( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -335,6 +338,7 @@ func (c *contactsClient) TestURLURL( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -359,6 +363,7 @@ func (c *contactsClient) TestURLURL( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/corge-http/corge-http.go b/examples/example-gateway/build/clients/corge-http/corge-http.go index a75c33972..c3ba713ae 100644 --- a/examples/example-gateway/build/clients/corge-http/corge-http.go +++ b/examples/example-gateway/build/clients/corge-http/corge-http.go @@ -31,6 +31,7 @@ import ( "time" "github.com/afex/hystrix-go/hystrix" + "go.uber.org/zap" "github.com/uber/zanzibar/config" zanzibar "github.com/uber/zanzibar/runtime" @@ -314,6 +315,7 @@ func (c *corgeHTTPClient) EchoString( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -338,6 +340,7 @@ func (c *corgeHTTPClient) EchoString( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -422,6 +425,7 @@ func (c *corgeHTTPClient) NoContent( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -446,6 +450,7 @@ func (c *corgeHTTPClient) NoContent( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -525,6 +530,7 @@ func (c *corgeHTTPClient) NoContentNoException( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -549,6 +555,7 @@ func (c *corgeHTTPClient) NoContentNoException( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -624,6 +631,7 @@ func (c *corgeHTTPClient) CorgeNoContentOnException( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -648,6 +656,7 @@ func (c *corgeHTTPClient) CorgeNoContentOnException( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/custom-bar/custom-bar.go b/examples/example-gateway/build/clients/custom-bar/custom-bar.go index fe8c818cd..aa06a2818 100644 --- a/examples/example-gateway/build/clients/custom-bar/custom-bar.go +++ b/examples/example-gateway/build/clients/custom-bar/custom-bar.go @@ -31,6 +31,7 @@ import ( "time" "github.com/afex/hystrix-go/hystrix" + "go.uber.org/zap" "github.com/pkg/errors" zanzibar "github.com/uber/zanzibar/runtime" @@ -47,6 +48,8 @@ const CustomTemplateTesting = "test" // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::custom-bar") + // Client defines custom-bar client interface. type Client interface { HTTPClient() *zanzibar.HTTPClient @@ -475,6 +478,7 @@ func (c *customBarClient) ArgNotStruct( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -499,6 +503,7 @@ func (c *customBarClient) ArgNotStruct( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -580,6 +585,7 @@ func (c *customBarClient) ArgWithHeaders( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -609,6 +615,7 @@ func (c *customBarClient) ArgWithHeaders( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -770,6 +777,7 @@ func (c *customBarClient) ArgWithManyQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -794,6 +802,7 @@ func (c *customBarClient) ArgWithManyQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -877,6 +886,7 @@ func (c *customBarClient) ArgWithNearDupQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -901,6 +911,7 @@ func (c *customBarClient) ArgWithNearDupQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1008,6 +1019,7 @@ func (c *customBarClient) ArgWithNestedQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1032,6 +1044,7 @@ func (c *customBarClient) ArgWithNestedQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1098,6 +1111,7 @@ func (c *customBarClient) ArgWithParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1122,6 +1136,7 @@ func (c *customBarClient) ArgWithParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1188,6 +1203,7 @@ func (c *customBarClient) ArgWithParamsAndDuplicateFields( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1212,6 +1228,7 @@ func (c *customBarClient) ArgWithParamsAndDuplicateFields( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1278,6 +1295,7 @@ func (c *customBarClient) ArgWithQueryHeader( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1302,6 +1320,7 @@ func (c *customBarClient) ArgWithQueryHeader( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1385,6 +1404,7 @@ func (c *customBarClient) ArgWithQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1409,6 +1429,7 @@ func (c *customBarClient) ArgWithQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1476,6 +1497,7 @@ func (c *customBarClient) DeleteFoo( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1505,6 +1527,7 @@ func (c *customBarClient) DeleteFoo( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1563,6 +1586,7 @@ func (c *customBarClient) DeleteWithBody( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1587,6 +1611,7 @@ func (c *customBarClient) DeleteWithBody( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1654,6 +1679,7 @@ func (c *customBarClient) DeleteWithQueryParams( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1678,6 +1704,7 @@ func (c *customBarClient) DeleteWithQueryParams( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1736,6 +1763,7 @@ func (c *customBarClient) Hello( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1760,6 +1788,7 @@ func (c *customBarClient) Hello( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1853,6 +1882,7 @@ func (c *customBarClient) ListAndEnum( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1877,6 +1907,7 @@ func (c *customBarClient) ListAndEnum( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1952,6 +1983,7 @@ func (c *customBarClient) MissingArg( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1976,6 +2008,7 @@ func (c *customBarClient) MissingArg( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2052,6 +2085,7 @@ func (c *customBarClient) NoRequest( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2076,6 +2110,7 @@ func (c *customBarClient) NoRequest( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2153,6 +2188,7 @@ func (c *customBarClient) Normal( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2177,6 +2213,7 @@ func (c *customBarClient) Normal( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2254,6 +2291,7 @@ func (c *customBarClient) NormalRecur( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2278,6 +2316,7 @@ func (c *customBarClient) NormalRecur( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2354,6 +2393,7 @@ func (c *customBarClient) TooManyArgs( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2378,6 +2418,7 @@ func (c *customBarClient) TooManyArgs( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2464,6 +2505,7 @@ func (c *customBarClient) EchoBinary( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2493,6 +2535,7 @@ func (c *customBarClient) EchoBinary( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2552,6 +2595,7 @@ func (c *customBarClient) EchoBool( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2581,6 +2625,7 @@ func (c *customBarClient) EchoBool( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2646,6 +2691,7 @@ func (c *customBarClient) EchoDouble( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2675,6 +2721,7 @@ func (c *customBarClient) EchoDouble( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2740,6 +2787,7 @@ func (c *customBarClient) EchoEnum( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2769,6 +2817,7 @@ func (c *customBarClient) EchoEnum( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2834,6 +2883,7 @@ func (c *customBarClient) EchoI16( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2863,6 +2913,7 @@ func (c *customBarClient) EchoI16( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2928,6 +2979,7 @@ func (c *customBarClient) EchoI32( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2957,6 +3009,7 @@ func (c *customBarClient) EchoI32( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3022,6 +3075,7 @@ func (c *customBarClient) EchoI32Map( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3051,6 +3105,7 @@ func (c *customBarClient) EchoI32Map( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3116,6 +3171,7 @@ func (c *customBarClient) EchoI64( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3145,6 +3201,7 @@ func (c *customBarClient) EchoI64( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3210,6 +3267,7 @@ func (c *customBarClient) EchoI8( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3239,6 +3297,7 @@ func (c *customBarClient) EchoI8( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3304,6 +3363,7 @@ func (c *customBarClient) EchoString( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3333,6 +3393,7 @@ func (c *customBarClient) EchoString( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3398,6 +3459,7 @@ func (c *customBarClient) EchoStringList( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3427,6 +3489,7 @@ func (c *customBarClient) EchoStringList( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3492,6 +3555,7 @@ func (c *customBarClient) EchoStringMap( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3521,6 +3585,7 @@ func (c *customBarClient) EchoStringMap( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3586,6 +3651,7 @@ func (c *customBarClient) EchoStringSet( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3615,6 +3681,7 @@ func (c *customBarClient) EchoStringSet( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3680,6 +3747,7 @@ func (c *customBarClient) EchoStructList( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3709,6 +3777,7 @@ func (c *customBarClient) EchoStructList( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3774,6 +3843,7 @@ func (c *customBarClient) EchoStructSet( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3803,6 +3873,7 @@ func (c *customBarClient) EchoStructSet( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3868,6 +3939,7 @@ func (c *customBarClient) EchoTypedef( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3897,6 +3969,7 @@ func (c *customBarClient) EchoTypedef( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/google-now/google-now.go b/examples/example-gateway/build/clients/google-now/google-now.go index d3c85568c..da8cd2a7a 100644 --- a/examples/example-gateway/build/clients/google-now/google-now.go +++ b/examples/example-gateway/build/clients/google-now/google-now.go @@ -241,6 +241,7 @@ func (c *googleNowClient) AddCredentials( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -271,6 +272,7 @@ func (c *googleNowClient) AddCredentials( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -329,6 +331,7 @@ func (c *googleNowClient) CheckCredentials( err := req.WriteJSON("POST", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -359,6 +362,7 @@ func (c *googleNowClient) CheckCredentials( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, nil, err } diff --git a/examples/example-gateway/build/clients/multi/multi.go b/examples/example-gateway/build/clients/multi/multi.go index 7af1674e6..059d61fb4 100644 --- a/examples/example-gateway/build/clients/multi/multi.go +++ b/examples/example-gateway/build/clients/multi/multi.go @@ -29,6 +29,7 @@ import ( "time" "github.com/afex/hystrix-go/hystrix" + "go.uber.org/zap" zanzibar "github.com/uber/zanzibar/runtime" "github.com/uber/zanzibar/runtime/jsonwrapper" @@ -238,6 +239,7 @@ func (c *multiClient) HelloA( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -262,6 +264,7 @@ func (c *multiClient) HelloA( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -326,6 +329,7 @@ func (c *multiClient) HelloB( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -350,6 +354,7 @@ func (c *multiClient) HelloB( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/withexceptions/withexceptions.go b/examples/example-gateway/build/clients/withexceptions/withexceptions.go index b46559ebb..12625e392 100644 --- a/examples/example-gateway/build/clients/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/clients/withexceptions/withexceptions.go @@ -29,6 +29,7 @@ import ( "time" "github.com/afex/hystrix-go/hystrix" + "go.uber.org/zap" zanzibar "github.com/uber/zanzibar/runtime" "github.com/uber/zanzibar/runtime/jsonwrapper" @@ -233,6 +234,7 @@ func (c *withexceptionsClient) Func1( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -257,6 +259,7 @@ func (c *withexceptionsClient) Func1( } } if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making http call: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } From 0effad06345b8b507e790e48194e73b79b48da5b Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 18:25:39 +0530 Subject: [PATCH 60/86] refact --- codegen/templates/http_client.tmpl | 2 +- codegen/templates/http_client_test.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index 91eed50c1..f1b4fd0d6 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -340,7 +340,7 @@ func (c *{{$clientName}}) {{$methodName}}( err := req.WriteJSON("{{.HTTPMethod}}", fullURL, headers, nil) {{end}} {{- /* */ -}} if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return {{if eq .ResponseType ""}}ctx, nil, err{{else}}ctx, defaultRes, nil, err{{end}} } diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index bd515ed94..4881abbae 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -342,7 +342,7 @@ func (c *{{$clientName}}) {{$methodName}}( err := req.WriteJSON("{{.HTTPMethod}}", fullURL, headers, nil) {{end}} {{- /* */ -}} if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return {{if eq .ResponseType ""}}ctx, nil, err{{else}}ctx, defaultRes, nil, err{{end}} } From 3dbdec74c7c4ed15f9517e4845fdd92c8bb07735 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 21:47:49 +0530 Subject: [PATCH 61/86] refact --- runtime/context.go | 5 ----- runtime/log_util.go | 1 - runtime/tchannel_client.go | 2 -- 3 files changed, 8 deletions(-) diff --git a/runtime/context.go b/runtime/context.go index 1fc768db5..07fd05576 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -206,11 +206,6 @@ func GetShardKeyFromCtx(ctx context.Context) string { return "" } -type safeFields struct { - mu sync.Mutex - fields []zap.Field -} - // WithLogFields returns a new context with the given log fields attached to context.Context // // Deprecated: See AppendLogFieldsToContext. diff --git a/runtime/log_util.go b/runtime/log_util.go index ea7721075..17f373f69 100644 --- a/runtime/log_util.go +++ b/runtime/log_util.go @@ -6,7 +6,6 @@ var ( LogFieldErrTypeClientException = LogFieldErrorType("client_exception") LogFieldErrTypeTChannelError = LogFieldErrorType("tchannel_error") LogFieldErrTypeBadResponse = LogFieldErrorType("bad_response") - LogFieldErrTypeBadRequest = LogFieldErrorType("bad_request") LogFieldErrLocClient = LogFieldErrorLocation("client") ) diff --git a/runtime/tchannel_client.go b/runtime/tchannel_client.go index 1c368a3f9..d4aae6d63 100644 --- a/runtime/tchannel_client.go +++ b/runtime/tchannel_client.go @@ -29,7 +29,6 @@ import ( "github.com/uber-go/tally" "github.com/uber/tchannel-go" "github.com/uber/zanzibar/runtime/ruleengine" - "go.uber.org/zap" netContext "golang.org/x/net/context" ) @@ -279,7 +278,6 @@ func (c *TChannelClient) call( }) if err != nil { - AppendLogFieldsToContext(ctx, zap.Error(err), LogFieldErrTypeTChannelError, LogFieldErrLocClient) // Do not wrap system errors. if _, ok := err.(tchannel.SystemError); ok { return call.success, call.resHeaders, err From 836da3bbed6e59b83a174a727cee4ff08be3df7d Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 22:36:22 +0530 Subject: [PATCH 62/86] refact --- codegen/templates/tchannel_client.tmpl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/codegen/templates/tchannel_client.tmpl b/codegen/templates/tchannel_client.tmpl index baa482c0f..14d3ad052 100644 --- a/codegen/templates/tchannel_client.tmpl +++ b/codegen/templates/tchannel_client.tmpl @@ -36,6 +36,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::{{$instance.InstanceName}}") + // Client defines {{$clientID}} client interface. type Client interface { {{range $svc := .Services -}} @@ -379,13 +381,16 @@ type {{$clientName}} struct { err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { {{range .Exceptions -}} case result.{{title .Name}} != nil: err = result.{{title .Name}} - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -394,7 +399,7 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -411,7 +416,7 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err From fb954548fb3c8761cd48d64d4d138ba67504d9c8 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 22:36:32 +0530 Subject: [PATCH 63/86] codegen --- codegen/template_bundle/template_files.go | 21 +- .../example-gateway/build/clients/bar/bar.go | 70 +++--- .../example-gateway/build/clients/baz/baz.go | 214 ++++++++++++------ .../build/clients/contacts/contacts.go | 4 +- .../build/clients/corge-http/corge-http.go | 8 +- .../build/clients/corge/corge.go | 10 +- .../build/clients/custom-bar/custom-bar.go | 70 +++--- .../build/clients/google-now/google-now.go | 4 +- .../build/clients/multi/multi.go | 4 +- .../clients/withexceptions/withexceptions.go | 2 +- 10 files changed, 251 insertions(+), 156 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 746ac9e6c..58848b07f 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -1797,7 +1797,7 @@ func (c *{{$clientName}}) {{$methodName}}( err := req.WriteJSON("{{.HTTPMethod}}", fullURL, headers, nil) {{end}} {{- /* */ -}} if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return {{if eq .ResponseType ""}}ctx, nil, err{{else}}ctx, defaultRes, nil, err{{end}} } @@ -2031,7 +2031,7 @@ func http_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client.tmpl", size: 19947, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client.tmpl", size: 19938, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2380,7 +2380,7 @@ func (c *{{$clientName}}) {{$methodName}}( err := req.WriteJSON("{{.HTTPMethod}}", fullURL, headers, nil) {{end}} {{- /* */ -}} if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return {{if eq .ResponseType ""}}ctx, nil, err{{else}}ctx, defaultRes, nil, err{{end}} } @@ -2613,7 +2613,7 @@ func http_client_testTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client_test.tmpl", size: 19974, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client_test.tmpl", size: 19965, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3602,6 +3602,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::{{$instance.InstanceName}}") + // Client defines {{$clientID}} client interface. type Client interface { {{range $svc := .Services -}} @@ -3945,13 +3947,16 @@ type {{$clientName}} struct { err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { {{range .Exceptions -}} case result.{{title .Name}} != nil: err = result.{{title .Name}} - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) {{end -}} {{if ne .ResponseType "" -}} case result.Success != nil: @@ -3960,7 +3965,7 @@ type {{$clientName}} struct { {{end -}} default: err = errors.New("{{$clientName}} received no result or unknown exception for {{title .Name}}") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -3977,7 +3982,7 @@ type {{$clientName}} struct { {{else -}} resp, err = {{.GenCodePkgName}}.{{title $svc.Name}}_{{title .Name}}_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -3998,7 +4003,7 @@ func tchannel_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16059, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client.tmpl", size: 16209, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index 3e09eee18..a9d67db27 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -475,7 +475,7 @@ func (c *barClient) ArgNotStruct( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -582,7 +582,7 @@ func (c *barClient) ArgWithHeaders( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -775,7 +775,7 @@ func (c *barClient) ArgWithManyQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -884,7 +884,7 @@ func (c *barClient) ArgWithNearDupQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1017,7 +1017,7 @@ func (c *barClient) ArgWithNestedQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1109,7 +1109,7 @@ func (c *barClient) ArgWithParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1201,7 +1201,7 @@ func (c *barClient) ArgWithParamsAndDuplicateFields( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1293,7 +1293,7 @@ func (c *barClient) ArgWithQueryHeader( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1402,7 +1402,7 @@ func (c *barClient) ArgWithQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1495,7 +1495,7 @@ func (c *barClient) DeleteFoo( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1585,7 +1585,7 @@ func (c *barClient) DeleteWithBody( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1678,7 +1678,7 @@ func (c *barClient) DeleteWithQueryParams( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1762,7 +1762,7 @@ func (c *barClient) Hello( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1881,7 +1881,7 @@ func (c *barClient) ListAndEnum( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1982,7 +1982,7 @@ func (c *barClient) MissingArg( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2084,7 +2084,7 @@ func (c *barClient) NoRequest( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2187,7 +2187,7 @@ func (c *barClient) Normal( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2290,7 +2290,7 @@ func (c *barClient) NormalRecur( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2392,7 +2392,7 @@ func (c *barClient) TooManyArgs( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2504,7 +2504,7 @@ func (c *barClient) EchoBinary( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2595,7 +2595,7 @@ func (c *barClient) EchoBool( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2692,7 +2692,7 @@ func (c *barClient) EchoDouble( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2789,7 +2789,7 @@ func (c *barClient) EchoEnum( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2886,7 +2886,7 @@ func (c *barClient) EchoI16( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2983,7 +2983,7 @@ func (c *barClient) EchoI32( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3080,7 +3080,7 @@ func (c *barClient) EchoI32Map( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3177,7 +3177,7 @@ func (c *barClient) EchoI64( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3274,7 +3274,7 @@ func (c *barClient) EchoI8( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3371,7 +3371,7 @@ func (c *barClient) EchoString( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3468,7 +3468,7 @@ func (c *barClient) EchoStringList( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3565,7 +3565,7 @@ func (c *barClient) EchoStringMap( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3662,7 +3662,7 @@ func (c *barClient) EchoStringSet( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3759,7 +3759,7 @@ func (c *barClient) EchoStructList( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3856,7 +3856,7 @@ func (c *barClient) EchoStructSet( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3953,7 +3953,7 @@ func (c *barClient) EchoTypedef( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/baz/baz.go b/examples/example-gateway/build/clients/baz/baz.go index 243d6c43b..228c1bd29 100644 --- a/examples/example-gateway/build/clients/baz/baz.go +++ b/examples/example-gateway/build/clients/baz/baz.go @@ -26,6 +26,7 @@ package bazclient import ( "context" "errors" + "fmt" "net/textproto" "strconv" "strings" @@ -47,6 +48,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::baz") + // Client defines baz client interface. type Client interface { EchoBinary( @@ -531,6 +534,9 @@ func (c *bazClient) EchoBinary( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -539,7 +545,7 @@ func (c *bazClient) EchoBinary( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBinary") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -549,7 +555,7 @@ func (c *bazClient) EchoBinary( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBinary_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -597,6 +603,9 @@ func (c *bazClient) EchoBool( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -605,7 +614,7 @@ func (c *bazClient) EchoBool( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoBool") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -615,7 +624,7 @@ func (c *bazClient) EchoBool( resp, err = clientsIDlClientsBazBaz.SecondService_EchoBool_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -663,6 +672,9 @@ func (c *bazClient) EchoDouble( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -671,7 +683,7 @@ func (c *bazClient) EchoDouble( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoDouble") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -681,7 +693,7 @@ func (c *bazClient) EchoDouble( resp, err = clientsIDlClientsBazBaz.SecondService_EchoDouble_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -729,6 +741,9 @@ func (c *bazClient) EchoEnum( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -737,7 +752,7 @@ func (c *bazClient) EchoEnum( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoEnum") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -747,7 +762,7 @@ func (c *bazClient) EchoEnum( resp, err = clientsIDlClientsBazBaz.SecondService_EchoEnum_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -795,6 +810,9 @@ func (c *bazClient) EchoI16( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -803,7 +821,7 @@ func (c *bazClient) EchoI16( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI16") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -813,7 +831,7 @@ func (c *bazClient) EchoI16( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI16_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -861,6 +879,9 @@ func (c *bazClient) EchoI32( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -869,7 +890,7 @@ func (c *bazClient) EchoI32( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI32") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -879,7 +900,7 @@ func (c *bazClient) EchoI32( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI32_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -927,6 +948,9 @@ func (c *bazClient) EchoI64( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -935,7 +959,7 @@ func (c *bazClient) EchoI64( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI64") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -945,7 +969,7 @@ func (c *bazClient) EchoI64( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI64_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -993,6 +1017,9 @@ func (c *bazClient) EchoI8( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1001,7 +1028,7 @@ func (c *bazClient) EchoI8( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoI8") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1011,7 +1038,7 @@ func (c *bazClient) EchoI8( resp, err = clientsIDlClientsBazBaz.SecondService_EchoI8_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1059,6 +1086,9 @@ func (c *bazClient) EchoString( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1067,7 +1097,7 @@ func (c *bazClient) EchoString( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoString") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1077,7 +1107,7 @@ func (c *bazClient) EchoString( resp, err = clientsIDlClientsBazBaz.SecondService_EchoString_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1125,6 +1155,9 @@ func (c *bazClient) EchoStringList( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1133,7 +1166,7 @@ func (c *bazClient) EchoStringList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringList") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1143,7 +1176,7 @@ func (c *bazClient) EchoStringList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringList_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1191,6 +1224,9 @@ func (c *bazClient) EchoStringMap( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1199,7 +1235,7 @@ func (c *bazClient) EchoStringMap( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringMap") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1209,7 +1245,7 @@ func (c *bazClient) EchoStringMap( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringMap_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1257,6 +1293,9 @@ func (c *bazClient) EchoStringSet( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1265,7 +1304,7 @@ func (c *bazClient) EchoStringSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStringSet") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1275,7 +1314,7 @@ func (c *bazClient) EchoStringSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStringSet_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1323,6 +1362,9 @@ func (c *bazClient) EchoStructList( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1331,7 +1373,7 @@ func (c *bazClient) EchoStructList( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructList") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1341,7 +1383,7 @@ func (c *bazClient) EchoStructList( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructList_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1389,6 +1431,9 @@ func (c *bazClient) EchoStructSet( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1397,7 +1442,7 @@ func (c *bazClient) EchoStructSet( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoStructSet") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1407,7 +1452,7 @@ func (c *bazClient) EchoStructSet( resp, err = clientsIDlClientsBazBaz.SecondService_EchoStructSet_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1455,6 +1500,9 @@ func (c *bazClient) EchoTypedef( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1463,7 +1511,7 @@ func (c *bazClient) EchoTypedef( success = true default: err = errors.New("bazClient received no result or unknown exception for EchoTypedef") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1473,7 +1521,7 @@ func (c *bazClient) EchoTypedef( resp, err = clientsIDlClientsBazBaz.SecondService_EchoTypedef_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1520,15 +1568,18 @@ func (c *bazClient) Call( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) default: err = errors.New("bazClient received no result or unknown exception for Call") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1581,21 +1632,24 @@ func (c *bazClient) Compare( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.OtherAuthErr != nil: err = result.OtherAuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for Compare. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Compare") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1605,7 +1659,7 @@ func (c *bazClient) Compare( resp, err = clientsIDlClientsBazBaz.SimpleService_Compare_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1653,18 +1707,21 @@ func (c *bazClient) GetProfile( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for GetProfile. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for GetProfile") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1674,7 +1731,7 @@ func (c *bazClient) GetProfile( resp, err = clientsIDlClientsBazBaz.SimpleService_GetProfile_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1722,21 +1779,24 @@ func (c *bazClient) HeaderSchema( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.OtherAuthErr != nil: err = result.OtherAuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for HeaderSchema. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for HeaderSchema") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1746,7 +1806,7 @@ func (c *bazClient) HeaderSchema( resp, err = clientsIDlClientsBazBaz.SimpleService_HeaderSchema_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1794,6 +1854,9 @@ func (c *bazClient) Ping( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -1802,7 +1865,7 @@ func (c *bazClient) Ping( success = true default: err = errors.New("bazClient received no result or unknown exception for Ping") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1812,7 +1875,7 @@ func (c *bazClient) Ping( resp, err = clientsIDlClientsBazBaz.SimpleService_Ping_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -1859,18 +1922,21 @@ func (c *bazClient) DeliberateDiffNoop( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.ServerErr != nil: err = result.ServerErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) default: err = errors.New("bazClient received no result or unknown exception for SillyNoop") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1922,12 +1988,15 @@ func (c *bazClient) TestUUID( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { default: err = errors.New("bazClient received no result or unknown exception for TestUuid") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -1980,21 +2049,24 @@ func (c *bazClient) Trans( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.OtherAuthErr != nil: err = result.OtherAuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for Trans. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for Trans") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -2004,7 +2076,7 @@ func (c *bazClient) Trans( resp, err = clientsIDlClientsBazBaz.SimpleService_Trans_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -2052,21 +2124,24 @@ func (c *bazClient) TransHeaders( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.OtherAuthErr != nil: err = result.OtherAuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeaders. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeaders") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -2076,7 +2151,7 @@ func (c *bazClient) TransHeaders( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeaders_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -2124,18 +2199,21 @@ func (c *bazClient) TransHeadersNoReq( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeadersNoReq. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersNoReq") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -2145,7 +2223,7 @@ func (c *bazClient) TransHeadersNoReq( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersNoReq_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -2193,21 +2271,24 @@ func (c *bazClient) TransHeadersType( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { case result.AuthErr != nil: err = result.AuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.OtherAuthErr != nil: err = result.OtherAuthErr - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) case result.Success != nil: ctx = logger.WarnZ(ctx, "Internal error. Success flag is not set for TransHeadersType. Overriding") success = true default: err = errors.New("bazClient received no result or unknown exception for TransHeadersType") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -2217,7 +2298,7 @@ func (c *bazClient) TransHeadersType( resp, err = clientsIDlClientsBazBaz.SimpleService_TransHeadersType_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err @@ -2264,12 +2345,15 @@ func (c *bazClient) URLTest( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { default: err = errors.New("bazClient received no result or unknown exception for UrlTest") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { diff --git a/examples/example-gateway/build/clients/contacts/contacts.go b/examples/example-gateway/build/clients/contacts/contacts.go index b639d39a6..b393018ab 100644 --- a/examples/example-gateway/build/clients/contacts/contacts.go +++ b/examples/example-gateway/build/clients/contacts/contacts.go @@ -242,7 +242,7 @@ func (c *contactsClient) SaveContacts( err := req.WriteJSON("POST", fullURL, headers, r.SaveContactsRequest) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -338,7 +338,7 @@ func (c *contactsClient) TestURLURL( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/corge-http/corge-http.go b/examples/example-gateway/build/clients/corge-http/corge-http.go index c3ba713ae..5959b6538 100644 --- a/examples/example-gateway/build/clients/corge-http/corge-http.go +++ b/examples/example-gateway/build/clients/corge-http/corge-http.go @@ -315,7 +315,7 @@ func (c *corgeHTTPClient) EchoString( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -425,7 +425,7 @@ func (c *corgeHTTPClient) NoContent( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -530,7 +530,7 @@ func (c *corgeHTTPClient) NoContentNoException( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -631,7 +631,7 @@ func (c *corgeHTTPClient) CorgeNoContentOnException( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/corge/corge.go b/examples/example-gateway/build/clients/corge/corge.go index 2246539b1..6907b5af6 100644 --- a/examples/example-gateway/build/clients/corge/corge.go +++ b/examples/example-gateway/build/clients/corge/corge.go @@ -26,6 +26,7 @@ package corgeclient import ( "context" "errors" + "fmt" "net/textproto" "strconv" "strings" @@ -46,6 +47,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::corge") + // Client defines corge client interface. type Client interface { EchoString( @@ -350,6 +353,9 @@ func (c *corgeClient) EchoString( err = clientErr } } + if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making tchannel call: %s", err)), logFieldErrLocation) + } if err == nil && !success { switch { @@ -358,7 +364,7 @@ func (c *corgeClient) EchoString( success = true default: err = errors.New("corgeClient received no result or unknown exception for EchoString") - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) } } if err != nil { @@ -368,7 +374,7 @@ func (c *corgeClient) EchoString( resp, err = clientsIDlClientsCorgeCorge.Corge_EchoString_Helper.UnwrapResponse(&result) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeBadResponse, zanzibar.LogFieldErrLocClient) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) ctx = logger.WarnZ(ctx, "Client failure: unable to unwrap client response") } return ctx, resp, respHeaders, err diff --git a/examples/example-gateway/build/clients/custom-bar/custom-bar.go b/examples/example-gateway/build/clients/custom-bar/custom-bar.go index aa06a2818..c744efc91 100644 --- a/examples/example-gateway/build/clients/custom-bar/custom-bar.go +++ b/examples/example-gateway/build/clients/custom-bar/custom-bar.go @@ -478,7 +478,7 @@ func (c *customBarClient) ArgNotStruct( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -585,7 +585,7 @@ func (c *customBarClient) ArgWithHeaders( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -777,7 +777,7 @@ func (c *customBarClient) ArgWithManyQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -886,7 +886,7 @@ func (c *customBarClient) ArgWithNearDupQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1019,7 +1019,7 @@ func (c *customBarClient) ArgWithNestedQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1111,7 +1111,7 @@ func (c *customBarClient) ArgWithParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1203,7 +1203,7 @@ func (c *customBarClient) ArgWithParamsAndDuplicateFields( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1295,7 +1295,7 @@ func (c *customBarClient) ArgWithQueryHeader( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1404,7 +1404,7 @@ func (c *customBarClient) ArgWithQueryParams( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1497,7 +1497,7 @@ func (c *customBarClient) DeleteFoo( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1586,7 +1586,7 @@ func (c *customBarClient) DeleteWithBody( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1679,7 +1679,7 @@ func (c *customBarClient) DeleteWithQueryParams( err := req.WriteJSON("DELETE", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -1763,7 +1763,7 @@ func (c *customBarClient) Hello( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1882,7 +1882,7 @@ func (c *customBarClient) ListAndEnum( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -1983,7 +1983,7 @@ func (c *customBarClient) MissingArg( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2085,7 +2085,7 @@ func (c *customBarClient) NoRequest( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2188,7 +2188,7 @@ func (c *customBarClient) Normal( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2291,7 +2291,7 @@ func (c *customBarClient) NormalRecur( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2393,7 +2393,7 @@ func (c *customBarClient) TooManyArgs( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2505,7 +2505,7 @@ func (c *customBarClient) EchoBinary( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2595,7 +2595,7 @@ func (c *customBarClient) EchoBool( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2691,7 +2691,7 @@ func (c *customBarClient) EchoDouble( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2787,7 +2787,7 @@ func (c *customBarClient) EchoEnum( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2883,7 +2883,7 @@ func (c *customBarClient) EchoI16( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -2979,7 +2979,7 @@ func (c *customBarClient) EchoI32( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3075,7 +3075,7 @@ func (c *customBarClient) EchoI32Map( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3171,7 +3171,7 @@ func (c *customBarClient) EchoI64( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3267,7 +3267,7 @@ func (c *customBarClient) EchoI8( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3363,7 +3363,7 @@ func (c *customBarClient) EchoString( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3459,7 +3459,7 @@ func (c *customBarClient) EchoStringList( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3555,7 +3555,7 @@ func (c *customBarClient) EchoStringMap( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3651,7 +3651,7 @@ func (c *customBarClient) EchoStringSet( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3747,7 +3747,7 @@ func (c *customBarClient) EchoStructList( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3843,7 +3843,7 @@ func (c *customBarClient) EchoStructSet( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -3939,7 +3939,7 @@ func (c *customBarClient) EchoTypedef( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/google-now/google-now.go b/examples/example-gateway/build/clients/google-now/google-now.go index da8cd2a7a..50c4ff4ed 100644 --- a/examples/example-gateway/build/clients/google-now/google-now.go +++ b/examples/example-gateway/build/clients/google-now/google-now.go @@ -241,7 +241,7 @@ func (c *googleNowClient) AddCredentials( err := req.WriteJSON("POST", fullURL, headers, r) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } @@ -331,7 +331,7 @@ func (c *googleNowClient) CheckCredentials( err := req.WriteJSON("POST", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, nil, err } diff --git a/examples/example-gateway/build/clients/multi/multi.go b/examples/example-gateway/build/clients/multi/multi.go index 059d61fb4..ab666c364 100644 --- a/examples/example-gateway/build/clients/multi/multi.go +++ b/examples/example-gateway/build/clients/multi/multi.go @@ -239,7 +239,7 @@ func (c *multiClient) HelloA( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } @@ -329,7 +329,7 @@ func (c *multiClient) HelloB( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } diff --git a/examples/example-gateway/build/clients/withexceptions/withexceptions.go b/examples/example-gateway/build/clients/withexceptions/withexceptions.go index 12625e392..65871bca1 100644 --- a/examples/example-gateway/build/clients/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/clients/withexceptions/withexceptions.go @@ -234,7 +234,7 @@ func (c *withexceptionsClient) Func1( err := req.WriteJSON("GET", fullURL, headers, nil) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating outbound http request: %s", err)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error creating http request: %s", err)), logFieldErrLocation) return ctx, defaultRes, nil, err } From 76c5294baa2f8fb477c1576faf8b172fcaf559b3 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 23:28:33 +0530 Subject: [PATCH 64/86] refact --- codegen/templates/http_client.tmpl | 14 +++++++++++++ codegen/templates/http_client_test.tmpl | 14 +++++++++++++ runtime/client_http_response.go | 27 ++++--------------------- runtime/log_util.go | 8 +------- 4 files changed, 33 insertions(+), 30 deletions(-) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index f1b4fd0d6..64c0a7fd5 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -406,6 +406,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if and (ne (.OKStatusCode.Code) 204) (ne (.OKStatusCode.Code) 304) -}} _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } {{- end}} @@ -413,6 +414,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -425,6 +427,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if eq .ResponseType "[]byte"}} responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil @@ -432,10 +435,12 @@ func (c *{{$clientName}}) {{$methodName}}( var responseBody {{unref .ResponseType}} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -449,6 +454,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -458,6 +464,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if and (ne (.OKStatusCode.Code) 204) (ne (.OKStatusCode.Code) 304) -}} _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } {{- end}} @@ -481,6 +488,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, v.(error) @@ -489,6 +497,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -502,6 +511,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if eq .ResponseType "[]byte"}} responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil @@ -509,10 +519,12 @@ func (c *{{$clientName}}) {{$methodName}}( var responseBody {{unref .ResponseType}} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -541,6 +553,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -549,6 +562,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index 4881abbae..4c72ee936 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -407,6 +407,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if and (ne (.OKStatusCode.Code) 204) (ne (.OKStatusCode.Code) 304) -}} _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } {{- end}} @@ -414,6 +415,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -426,6 +428,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if eq .ResponseType "[]byte"}} responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil @@ -433,10 +436,12 @@ func (c *{{$clientName}}) {{$methodName}}( var responseBody {{unref .ResponseType}} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -450,6 +455,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -459,6 +465,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if and (ne (.OKStatusCode.Code) 204) (ne (.OKStatusCode.Code) 304) -}} _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } {{- end}} @@ -482,6 +489,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, v.(error) @@ -490,6 +498,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -503,6 +512,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if eq .ResponseType "[]byte"}} responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil @@ -510,10 +520,12 @@ func (c *{{$clientName}}) {{$methodName}}( var responseBody {{unref .ResponseType}} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -542,6 +554,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -550,6 +563,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } diff --git a/runtime/client_http_response.go b/runtime/client_http_response.go index e93492020..e90dcd521 100644 --- a/runtime/client_http_response.go +++ b/runtime/client_http_response.go @@ -84,11 +84,10 @@ func (res *ClientHTTPResponse) ReadAll() ([]byte, error) { cerr := res.rawResponse.Body.Close() if cerr != nil { /* coverage ignore next line */ - res.req.ContextLogger.WarnZ(res.req.ctx, "Could not close response body", zap.Error(cerr), LogFieldErrLocClient) + res.req.ContextLogger.WarnZ(res.req.ctx, "Could not close response body", zap.Error(cerr)) } if err != nil { - res.req.ContextLogger.ErrorZ(res.req.ctx, "Could not read response body", zap.Error(err), LogFieldErrLocClient) res.finish() return nil, errors.Wrapf( err, "Could not read %s.%s response body", @@ -120,8 +119,6 @@ func (res *ClientHTTPResponse) ReadAndUnmarshalBody(v interface{}) error { func (res *ClientHTTPResponse) UnmarshalBody(v interface{}, rawBody []byte) error { err := res.jsonWrapper.Unmarshal(rawBody, v) if err != nil { - res.req.ContextLogger.WarnZ(res.req.ctx, "Could not parse response json", zap.Error(err), - LogFieldErrTypeBadResponse, LogFieldErrLocClient) res.req.Metrics.IncCounter(res.req.ctx, clientHTTPUnmarshalError, 1) return errors.Wrapf( err, "Could not parse %s.%s response json", @@ -150,12 +147,8 @@ func (res *ClientHTTPResponse) ReadAndUnmarshalBodyMultipleOptions(vs []interfac merr = multierr.Append(merr, err) } - err = fmt.Errorf("all json serialization errors: %s", merr.Error()) - - res.req.ContextLogger.WarnZ(res.req.ctx, "Could not parse response json into any of provided interfaces", - zap.Error(err), LogFieldErrTypeBadResponse, LogFieldErrLocClient) return nil, errors.Wrapf( - err, "Could not parse %s.%s response json into any of provided interfaces", + merr, "Could not parse %s.%s response json into any of provided interfaces", res.req.ClientID, res.req.MethodName, ) } @@ -167,10 +160,7 @@ func (res *ClientHTTPResponse) CheckOKResponse(okResponses []int) { return } } - - res.req.ContextLogger.WarnZ(res.req.ctx, "Unknown response status code", - zap.Int("UnknownStatusCode", res.rawResponse.StatusCode), - ) + res.req.ContextLogger.WarnZ(res.req.ctx, "Received unexpected client response status code") } // finish will handle final logic, like metrics @@ -190,8 +180,6 @@ func (res *ClientHTTPResponse) finish() { res.finished = true res.finishTime = time.Now() - logFn := res.req.ContextLogger.DebugZ - // emit metrics delta := res.finishTime.Sub(res.req.startTime) res.req.Metrics.RecordTimer(res.req.ctx, clientLatency, delta) @@ -208,15 +196,8 @@ func (res *ClientHTTPResponse) finish() { } if !known || res.StatusCode >= 400 && res.StatusCode < 600 { res.req.Metrics.IncCounter(res.req.ctx, clientErrors, 1) - logFn = res.req.ContextLogger.WarnZ } - - // write logs - logFn( - res.req.ctx, - "Finished an outgoing client HTTP request", - clientHTTPLogFields(res.req, res)..., - ) + AppendLogFieldsToContext(res.req.ctx, clientHTTPLogFields(res.req, res)...) } func clientHTTPLogFields(req *ClientHTTPRequest, res *ClientHTTPResponse) []zapcore.Field { diff --git a/runtime/log_util.go b/runtime/log_util.go index 17f373f69..e2abbd1d9 100644 --- a/runtime/log_util.go +++ b/runtime/log_util.go @@ -2,13 +2,7 @@ package zanzibar import "go.uber.org/zap" -var ( - LogFieldErrTypeClientException = LogFieldErrorType("client_exception") - LogFieldErrTypeTChannelError = LogFieldErrorType("tchannel_error") - LogFieldErrTypeBadResponse = LogFieldErrorType("bad_response") - - LogFieldErrLocClient = LogFieldErrorLocation("client") -) +var LogFieldErrTypeClientException = LogFieldErrorType("client_exception") func LogFieldErrorType(errType string) zap.Field { return zap.String(logFieldErrorType, errType) From 57f95d53138bb1fa3de5ec9bc6aef37bdfc33557 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 23:30:17 +0530 Subject: [PATCH 65/86] codegen --- codegen/template_bundle/template_files.go | 32 ++++- .../example-gateway/build/clients/bar/bar.go | 109 ++++++++++++++++++ .../build/clients/contacts/contacts.go | 6 + .../build/clients/corge-http/corge-http.go | 8 ++ .../build/clients/custom-bar/custom-bar.go | 109 ++++++++++++++++++ .../build/clients/google-now/google-now.go | 4 + .../build/clients/multi/multi.go | 6 + .../clients/withexceptions/withexceptions.go | 4 + 8 files changed, 276 insertions(+), 2 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 58848b07f..a83b6de65 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -1863,6 +1863,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if and (ne (.OKStatusCode.Code) 204) (ne (.OKStatusCode.Code) 304) -}} _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } {{- end}} @@ -1870,6 +1871,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -1882,6 +1884,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if eq .ResponseType "[]byte"}} responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil @@ -1889,10 +1892,12 @@ func (c *{{$clientName}}) {{$methodName}}( var responseBody {{unref .ResponseType}} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -1906,6 +1911,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1915,6 +1921,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if and (ne (.OKStatusCode.Code) 204) (ne (.OKStatusCode.Code) 304) -}} _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } {{- end}} @@ -1938,6 +1945,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, v.(error) @@ -1946,6 +1954,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -1959,6 +1968,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if eq .ResponseType "[]byte"}} responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil @@ -1966,10 +1976,12 @@ func (c *{{$clientName}}) {{$methodName}}( var responseBody {{unref .ResponseType}} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -1998,6 +2010,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2006,6 +2019,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2031,7 +2045,7 @@ func http_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client.tmpl", size: 19938, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client.tmpl", size: 21052, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2445,6 +2459,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if and (ne (.OKStatusCode.Code) 204) (ne (.OKStatusCode.Code) 304) -}} _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } {{- end}} @@ -2452,6 +2467,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -2464,6 +2480,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if eq .ResponseType "[]byte"}} responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil @@ -2471,10 +2488,12 @@ func (c *{{$clientName}}) {{$methodName}}( var responseBody {{unref .ResponseType}} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2488,6 +2507,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2497,6 +2517,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if and (ne (.OKStatusCode.Code) 204) (ne (.OKStatusCode.Code) 304) -}} _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } {{- end}} @@ -2520,6 +2541,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, v.(error) @@ -2528,6 +2550,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -2541,6 +2564,7 @@ func (c *{{$clientName}}) {{$methodName}}( {{- if eq .ResponseType "[]byte"}} responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil @@ -2548,10 +2572,12 @@ func (c *{{$clientName}}) {{$methodName}}( var responseBody {{unref .ResponseType}} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2580,6 +2606,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2588,6 +2615,7 @@ func (c *{{$clientName}}) {{$methodName}}( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2613,7 +2641,7 @@ func http_client_testTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client_test.tmpl", size: 19965, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client_test.tmpl", size: 21079, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index a9d67db27..ea6029b0d 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -519,6 +519,7 @@ func (c *barClient) ArgNotStruct( case 200: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } @@ -529,6 +530,7 @@ func (c *barClient) ArgNotStruct( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, v.(error) @@ -536,6 +538,7 @@ func (c *barClient) ArgNotStruct( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -633,10 +636,12 @@ func (c *barClient) ArgWithHeaders( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -645,6 +650,7 @@ func (c *barClient) ArgWithHeaders( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -820,10 +826,12 @@ func (c *barClient) ArgWithManyQueryParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -832,6 +840,7 @@ func (c *barClient) ArgWithManyQueryParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -929,10 +938,12 @@ func (c *barClient) ArgWithNearDupQueryParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -941,6 +952,7 @@ func (c *barClient) ArgWithNearDupQueryParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1062,10 +1074,12 @@ func (c *barClient) ArgWithNestedQueryParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1074,6 +1088,7 @@ func (c *barClient) ArgWithNestedQueryParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1154,10 +1169,12 @@ func (c *barClient) ArgWithParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1166,6 +1183,7 @@ func (c *barClient) ArgWithParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1246,10 +1264,12 @@ func (c *barClient) ArgWithParamsAndDuplicateFields( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1258,6 +1278,7 @@ func (c *barClient) ArgWithParamsAndDuplicateFields( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1338,10 +1359,12 @@ func (c *barClient) ArgWithQueryHeader( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1350,6 +1373,7 @@ func (c *barClient) ArgWithQueryHeader( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1447,10 +1471,12 @@ func (c *barClient) ArgWithQueryParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1459,6 +1485,7 @@ func (c *barClient) ArgWithQueryParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1545,12 +1572,14 @@ func (c *barClient) DeleteFoo( case 200: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -1629,12 +1658,14 @@ func (c *barClient) DeleteWithBody( case 200: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -1722,12 +1753,14 @@ func (c *barClient) DeleteWithQueryParams( case 200: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -1807,10 +1840,12 @@ func (c *barClient) Hello( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -1824,6 +1859,7 @@ func (c *barClient) Hello( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -1831,6 +1867,7 @@ func (c *barClient) Hello( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1926,10 +1963,12 @@ func (c *barClient) ListAndEnum( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -1941,6 +1980,7 @@ func (c *barClient) ListAndEnum( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -1948,6 +1988,7 @@ func (c *barClient) ListAndEnum( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2027,10 +2068,12 @@ func (c *barClient) MissingArg( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -2043,6 +2086,7 @@ func (c *barClient) MissingArg( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2050,6 +2094,7 @@ func (c *barClient) MissingArg( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2129,10 +2174,12 @@ func (c *barClient) NoRequest( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -2145,6 +2192,7 @@ func (c *barClient) NoRequest( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2152,6 +2200,7 @@ func (c *barClient) NoRequest( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2232,10 +2281,12 @@ func (c *barClient) Normal( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -2248,6 +2299,7 @@ func (c *barClient) Normal( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2255,6 +2307,7 @@ func (c *barClient) Normal( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2335,10 +2388,12 @@ func (c *barClient) NormalRecur( var responseBody clientsIDlClientsBarBar.BarResponseRecur rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2350,6 +2405,7 @@ func (c *barClient) NormalRecur( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2357,6 +2413,7 @@ func (c *barClient) NormalRecur( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2437,10 +2494,12 @@ func (c *barClient) TooManyArgs( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -2453,6 +2512,7 @@ func (c *barClient) TooManyArgs( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2462,6 +2522,7 @@ func (c *barClient) TooManyArgs( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2469,6 +2530,7 @@ func (c *barClient) TooManyArgs( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2554,12 +2616,14 @@ func (c *barClient) EchoBinary( case 200: responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2646,10 +2710,12 @@ func (c *barClient) EchoBool( var responseBody bool rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2657,6 +2723,7 @@ func (c *barClient) EchoBool( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2743,10 +2810,12 @@ func (c *barClient) EchoDouble( var responseBody float64 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2754,6 +2823,7 @@ func (c *barClient) EchoDouble( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2840,10 +2910,12 @@ func (c *barClient) EchoEnum( var responseBody clientsIDlClientsBarBar.Fruit rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2851,6 +2923,7 @@ func (c *barClient) EchoEnum( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2937,10 +3010,12 @@ func (c *barClient) EchoI16( var responseBody int16 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2948,6 +3023,7 @@ func (c *barClient) EchoI16( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3034,10 +3110,12 @@ func (c *barClient) EchoI32( var responseBody int32 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3045,6 +3123,7 @@ func (c *barClient) EchoI32( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3131,10 +3210,12 @@ func (c *barClient) EchoI32Map( var responseBody map[int32]*clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3142,6 +3223,7 @@ func (c *barClient) EchoI32Map( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3228,10 +3310,12 @@ func (c *barClient) EchoI64( var responseBody int64 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3239,6 +3323,7 @@ func (c *barClient) EchoI64( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3325,10 +3410,12 @@ func (c *barClient) EchoI8( var responseBody int8 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3336,6 +3423,7 @@ func (c *barClient) EchoI8( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3422,10 +3510,12 @@ func (c *barClient) EchoString( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3433,6 +3523,7 @@ func (c *barClient) EchoString( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3519,10 +3610,12 @@ func (c *barClient) EchoStringList( var responseBody []string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3530,6 +3623,7 @@ func (c *barClient) EchoStringList( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3616,10 +3710,12 @@ func (c *barClient) EchoStringMap( var responseBody map[string]*clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3627,6 +3723,7 @@ func (c *barClient) EchoStringMap( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3713,10 +3810,12 @@ func (c *barClient) EchoStringSet( var responseBody map[string]struct{} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3724,6 +3823,7 @@ func (c *barClient) EchoStringSet( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3810,10 +3910,12 @@ func (c *barClient) EchoStructList( var responseBody []*clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3821,6 +3923,7 @@ func (c *barClient) EchoStructList( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3907,10 +4010,12 @@ func (c *barClient) EchoStructSet( var responseBody []*clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3918,6 +4023,7 @@ func (c *barClient) EchoStructSet( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -4004,10 +4110,12 @@ func (c *barClient) EchoTypedef( var responseBody clientsIDlClientsBarBar.UUID rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -4015,6 +4123,7 @@ func (c *barClient) EchoTypedef( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } diff --git a/examples/example-gateway/build/clients/contacts/contacts.go b/examples/example-gateway/build/clients/contacts/contacts.go index b393018ab..de221d6e0 100644 --- a/examples/example-gateway/build/clients/contacts/contacts.go +++ b/examples/example-gateway/build/clients/contacts/contacts.go @@ -287,10 +287,12 @@ func (c *contactsClient) SaveContacts( var responseBody clientsIDlClientsContactsContacts.SaveContactsResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -304,6 +306,7 @@ func (c *contactsClient) SaveContacts( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -383,10 +386,12 @@ func (c *contactsClient) TestURLURL( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -394,6 +399,7 @@ func (c *contactsClient) TestURLURL( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } diff --git a/examples/example-gateway/build/clients/corge-http/corge-http.go b/examples/example-gateway/build/clients/corge-http/corge-http.go index 5959b6538..688b8581d 100644 --- a/examples/example-gateway/build/clients/corge-http/corge-http.go +++ b/examples/example-gateway/build/clients/corge-http/corge-http.go @@ -360,10 +360,12 @@ func (c *corgeHTTPClient) EchoString( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -371,6 +373,7 @@ func (c *corgeHTTPClient) EchoString( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -476,6 +479,7 @@ func (c *corgeHTTPClient) NoContent( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -576,6 +580,7 @@ func (c *corgeHTTPClient) NoContentNoException( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -676,10 +681,12 @@ func (c *corgeHTTPClient) CorgeNoContentOnException( var responseBody clientsIDlClientsCorgeCorge.Foo rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -692,6 +699,7 @@ func (c *corgeHTTPClient) CorgeNoContentOnException( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } diff --git a/examples/example-gateway/build/clients/custom-bar/custom-bar.go b/examples/example-gateway/build/clients/custom-bar/custom-bar.go index c744efc91..acf8b2d0b 100644 --- a/examples/example-gateway/build/clients/custom-bar/custom-bar.go +++ b/examples/example-gateway/build/clients/custom-bar/custom-bar.go @@ -522,6 +522,7 @@ func (c *customBarClient) ArgNotStruct( case 200: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } @@ -532,6 +533,7 @@ func (c *customBarClient) ArgNotStruct( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, v.(error) @@ -539,6 +541,7 @@ func (c *customBarClient) ArgNotStruct( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -635,10 +638,12 @@ func (c *customBarClient) ArgWithHeaders( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -647,6 +652,7 @@ func (c *customBarClient) ArgWithHeaders( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -822,10 +828,12 @@ func (c *customBarClient) ArgWithManyQueryParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -834,6 +842,7 @@ func (c *customBarClient) ArgWithManyQueryParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -931,10 +940,12 @@ func (c *customBarClient) ArgWithNearDupQueryParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -943,6 +954,7 @@ func (c *customBarClient) ArgWithNearDupQueryParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1064,10 +1076,12 @@ func (c *customBarClient) ArgWithNestedQueryParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1076,6 +1090,7 @@ func (c *customBarClient) ArgWithNestedQueryParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1156,10 +1171,12 @@ func (c *customBarClient) ArgWithParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1168,6 +1185,7 @@ func (c *customBarClient) ArgWithParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1248,10 +1266,12 @@ func (c *customBarClient) ArgWithParamsAndDuplicateFields( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1260,6 +1280,7 @@ func (c *customBarClient) ArgWithParamsAndDuplicateFields( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1340,10 +1361,12 @@ func (c *customBarClient) ArgWithQueryHeader( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1352,6 +1375,7 @@ func (c *customBarClient) ArgWithQueryHeader( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1449,10 +1473,12 @@ func (c *customBarClient) ArgWithQueryParams( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -1461,6 +1487,7 @@ func (c *customBarClient) ArgWithQueryParams( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1546,12 +1573,14 @@ func (c *customBarClient) DeleteFoo( case 200: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -1630,12 +1659,14 @@ func (c *customBarClient) DeleteWithBody( case 200: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -1723,12 +1754,14 @@ func (c *customBarClient) DeleteWithQueryParams( case 200: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -1808,10 +1841,12 @@ func (c *customBarClient) Hello( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -1825,6 +1860,7 @@ func (c *customBarClient) Hello( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -1832,6 +1868,7 @@ func (c *customBarClient) Hello( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -1927,10 +1964,12 @@ func (c *customBarClient) ListAndEnum( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -1942,6 +1981,7 @@ func (c *customBarClient) ListAndEnum( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -1949,6 +1989,7 @@ func (c *customBarClient) ListAndEnum( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2028,10 +2069,12 @@ func (c *customBarClient) MissingArg( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -2044,6 +2087,7 @@ func (c *customBarClient) MissingArg( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2051,6 +2095,7 @@ func (c *customBarClient) MissingArg( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2130,10 +2175,12 @@ func (c *customBarClient) NoRequest( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -2146,6 +2193,7 @@ func (c *customBarClient) NoRequest( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2153,6 +2201,7 @@ func (c *customBarClient) NoRequest( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2233,10 +2282,12 @@ func (c *customBarClient) Normal( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -2249,6 +2300,7 @@ func (c *customBarClient) Normal( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2256,6 +2308,7 @@ func (c *customBarClient) Normal( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2336,10 +2389,12 @@ func (c *customBarClient) NormalRecur( var responseBody clientsIDlClientsBarBar.BarResponseRecur rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2351,6 +2406,7 @@ func (c *customBarClient) NormalRecur( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2358,6 +2414,7 @@ func (c *customBarClient) NormalRecur( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2438,10 +2495,12 @@ func (c *customBarClient) TooManyArgs( var responseBody clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } // TODO(jakev): read response headers and put them in body @@ -2454,6 +2513,7 @@ func (c *customBarClient) TooManyArgs( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2463,6 +2523,7 @@ func (c *customBarClient) TooManyArgs( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -2470,6 +2531,7 @@ func (c *customBarClient) TooManyArgs( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2554,12 +2616,14 @@ func (c *customBarClient) EchoBinary( case 200: responseBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, responseBody, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2645,10 +2709,12 @@ func (c *customBarClient) EchoBool( var responseBody bool rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2656,6 +2722,7 @@ func (c *customBarClient) EchoBool( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2741,10 +2808,12 @@ func (c *customBarClient) EchoDouble( var responseBody float64 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2752,6 +2821,7 @@ func (c *customBarClient) EchoDouble( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2837,10 +2907,12 @@ func (c *customBarClient) EchoEnum( var responseBody clientsIDlClientsBarBar.Fruit rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2848,6 +2920,7 @@ func (c *customBarClient) EchoEnum( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -2933,10 +3006,12 @@ func (c *customBarClient) EchoI16( var responseBody int16 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -2944,6 +3019,7 @@ func (c *customBarClient) EchoI16( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3029,10 +3105,12 @@ func (c *customBarClient) EchoI32( var responseBody int32 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3040,6 +3118,7 @@ func (c *customBarClient) EchoI32( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3125,10 +3204,12 @@ func (c *customBarClient) EchoI32Map( var responseBody map[int32]*clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3136,6 +3217,7 @@ func (c *customBarClient) EchoI32Map( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3221,10 +3303,12 @@ func (c *customBarClient) EchoI64( var responseBody int64 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3232,6 +3316,7 @@ func (c *customBarClient) EchoI64( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3317,10 +3402,12 @@ func (c *customBarClient) EchoI8( var responseBody int8 rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3328,6 +3415,7 @@ func (c *customBarClient) EchoI8( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3413,10 +3501,12 @@ func (c *customBarClient) EchoString( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3424,6 +3514,7 @@ func (c *customBarClient) EchoString( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3509,10 +3600,12 @@ func (c *customBarClient) EchoStringList( var responseBody []string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3520,6 +3613,7 @@ func (c *customBarClient) EchoStringList( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3605,10 +3699,12 @@ func (c *customBarClient) EchoStringMap( var responseBody map[string]*clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3616,6 +3712,7 @@ func (c *customBarClient) EchoStringMap( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3701,10 +3798,12 @@ func (c *customBarClient) EchoStringSet( var responseBody map[string]struct{} rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3712,6 +3811,7 @@ func (c *customBarClient) EchoStringSet( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3797,10 +3897,12 @@ func (c *customBarClient) EchoStructList( var responseBody []*clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3808,6 +3910,7 @@ func (c *customBarClient) EchoStructList( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3893,10 +3996,12 @@ func (c *customBarClient) EchoStructSet( var responseBody []*clientsIDlClientsBarBar.BarResponse rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -3904,6 +4009,7 @@ func (c *customBarClient) EchoStructSet( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -3989,10 +4095,12 @@ func (c *customBarClient) EchoTypedef( var responseBody clientsIDlClientsBarBar.UUID rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -4000,6 +4108,7 @@ func (c *customBarClient) EchoTypedef( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } diff --git a/examples/example-gateway/build/clients/google-now/google-now.go b/examples/example-gateway/build/clients/google-now/google-now.go index 50c4ff4ed..365fb494c 100644 --- a/examples/example-gateway/build/clients/google-now/google-now.go +++ b/examples/example-gateway/build/clients/google-now/google-now.go @@ -292,12 +292,14 @@ func (c *googleNowClient) AddCredentials( case 202: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } @@ -382,12 +384,14 @@ func (c *googleNowClient) CheckCredentials( case 202: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } return ctx, respHeaders, nil default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } } diff --git a/examples/example-gateway/build/clients/multi/multi.go b/examples/example-gateway/build/clients/multi/multi.go index ab666c364..5abf8c99e 100644 --- a/examples/example-gateway/build/clients/multi/multi.go +++ b/examples/example-gateway/build/clients/multi/multi.go @@ -284,10 +284,12 @@ func (c *multiClient) HelloA( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -295,6 +297,7 @@ func (c *multiClient) HelloA( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } @@ -374,10 +377,12 @@ func (c *multiClient) HelloB( var responseBody string rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -385,6 +390,7 @@ func (c *multiClient) HelloB( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } diff --git a/examples/example-gateway/build/clients/withexceptions/withexceptions.go b/examples/example-gateway/build/clients/withexceptions/withexceptions.go index 65871bca1..9c5dad364 100644 --- a/examples/example-gateway/build/clients/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/clients/withexceptions/withexceptions.go @@ -279,10 +279,12 @@ func (c *withexceptionsClient) Func1( var responseBody clientsIDlClientsWithexceptionsWithexceptions.Response rawBody, err := res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } err = res.UnmarshalBody(&responseBody, rawBody) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } @@ -294,6 +296,7 @@ func (c *withexceptionsClient) Func1( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } return ctx, defaultRes, respHeaders, v.(error) @@ -301,6 +304,7 @@ func (c *withexceptionsClient) Func1( default: _, err = res.ReadAll() if err != nil { + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } } From bc79d28c259a08799bcaccc57d10aea90108a4a7 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 23:37:59 +0530 Subject: [PATCH 66/86] add ut: --- runtime/log_util.go | 24 ++++++++++++++++++++++++ runtime/log_util_test.go | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 runtime/log_util_test.go diff --git a/runtime/log_util.go b/runtime/log_util.go index e2abbd1d9..fdcb05094 100644 --- a/runtime/log_util.go +++ b/runtime/log_util.go @@ -1,13 +1,37 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package zanzibar import "go.uber.org/zap" +// LogFieldErrTypeClientException is a log field used to tag errors corresponding +// to exceptions defined in client thrifts. var LogFieldErrTypeClientException = LogFieldErrorType("client_exception") +// LogFieldErrorType returns error_type log field with given value. func LogFieldErrorType(errType string) zap.Field { return zap.String(logFieldErrorType, errType) } +// LogFieldErrorLocation returns error_location log field with given value. func LogFieldErrorLocation(loc string) zap.Field { return zap.String(logFieldErrorLocation, loc) } diff --git a/runtime/log_util_test.go b/runtime/log_util_test.go new file mode 100644 index 000000000..3c8a26c8e --- /dev/null +++ b/runtime/log_util_test.go @@ -0,0 +1,39 @@ +// Copyright (c) 2023 Uber Technologies, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +package zanzibar_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + zanzibar "github.com/uber/zanzibar/runtime" + "go.uber.org/zap" +) + +func TestLogFieldErrorType(t *testing.T) { + field := zanzibar.LogFieldErrorType("foo") + assert.Equal(t, zap.String("error_type", "foo"), field) +} + +func TestLogFieldErrorLocation(t *testing.T) { + field := zanzibar.LogFieldErrorLocation("bar") + assert.Equal(t, zap.String("error_location", "bar"), field) +} From 0b24db91c9861ef9484cdc409cf16c2f5ce8f61f Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Wed, 12 Jul 2023 23:53:33 +0530 Subject: [PATCH 67/86] grpc client --- codegen/templates/grpc_client.tmpl | 3 +++ runtime/grpc_client.go | 13 +++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/codegen/templates/grpc_client.tmpl b/codegen/templates/grpc_client.tmpl index e9773ad02..b6f888512 100644 --- a/codegen/templates/grpc_client.tmpl +++ b/codegen/templates/grpc_client.tmpl @@ -25,6 +25,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::{{$instance.InstanceName}}") + // Client defines {{$clientID}} client interface. type Client interface { {{range $i, $svc := .ProtoServices -}} @@ -216,6 +218,7 @@ func (e *{{$clientName}}) {{$methodName}}( return err }, nil) } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making grpc call: %s", err)), logFieldErrLocation) callHelper.Finish(ctx, err) return ctx, result, err diff --git a/runtime/grpc_client.go b/runtime/grpc_client.go index 57f9244bb..72df08abb 100644 --- a/runtime/grpc_client.go +++ b/runtime/grpc_client.go @@ -113,11 +113,6 @@ func (c *callHelper) Finish(ctx context.Context, err error) context.Context { c.metrics.RecordTimer(ctx, clientLatency, delta) c.metrics.RecordHistogramDuration(ctx, clientLatency, delta) var fields []zapcore.Field - ctx = WithEndpointRequestHeadersField(ctx, map[string]string{}) - if c.extractor != nil { - fields = append(fields, c.extractor.ExtractLogFields(ctx)...) - } - fields = append(fields, GetLogFieldsFromCtx(ctx)...) if err != nil { if yarpcerrors.IsStatus(err) { yarpcErr := yarpcerrors.FromError(err) @@ -126,11 +121,9 @@ func (c *callHelper) Finish(ctx context.Context, err error) context.Context { errCode.WriteString(yarpcErr.Code().String()) c.metrics.IncCounter(ctx, errCode.String(), 1) - fields = append(fields, zap.Int("code", int(yarpcErr.Code()))) - fields = append(fields, zap.String("message", yarpcErr.Message())) - fields = append(fields, zap.String("name", yarpcErr.Name())) - } else { - fields = append(fields, zap.Error(err)) + fields = append(fields, zap.Int("grpc_client_error.code", int(yarpcErr.Code()))) + fields = append(fields, zap.String("grpc_client_error.message", yarpcErr.Message())) + fields = append(fields, zap.String("grpc_client_error.name", yarpcErr.Name())) } c.metrics.IncCounter(ctx, "client.errors", 1) c.contextLogger.WarnZ(ctx, "Failed to send outgoing client gRPC request", fields...) From 0af96e038f8a69955e4e002e3989e2059bb135a4 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Thu, 13 Jul 2023 00:05:44 +0530 Subject: [PATCH 68/86] codegen --- codegen/template_bundle/template_files.go | 5 ++++- examples/selective-gateway/build/clients/echo/echo.go | 5 +++++ examples/selective-gateway/build/clients/mirror/mirror.go | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index a83b6de65..b2d4aad05 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -1240,6 +1240,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::{{$instance.InstanceName}}") + // Client defines {{$clientID}} client interface. type Client interface { {{range $i, $svc := .ProtoServices -}} @@ -1431,6 +1433,7 @@ func (e *{{$clientName}}) {{$methodName}}( return err }, nil) } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making grpc call: %s", err)), logFieldErrLocation) callHelper.Finish(ctx, err) return ctx, result, err @@ -1450,7 +1453,7 @@ func grpc_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "grpc_client.tmpl", size: 8644, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "grpc_client.tmpl", size: 8870, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/selective-gateway/build/clients/echo/echo.go b/examples/selective-gateway/build/clients/echo/echo.go index 9e3850e32..01b091402 100644 --- a/examples/selective-gateway/build/clients/echo/echo.go +++ b/examples/selective-gateway/build/clients/echo/echo.go @@ -25,9 +25,11 @@ package echoclient import ( "context" + "fmt" "github.com/afex/hystrix-go/hystrix" "go.uber.org/yarpc" + "go.uber.org/zap" module "github.com/uber/zanzibar/examples/selective-gateway/build/clients/echo/module" gen "github.com/uber/zanzibar/examples/selective-gateway/build/proto-gen/clients/echo" @@ -38,6 +40,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::echo") + // Client defines echo client interface. type Client interface { EchoEcho( @@ -202,6 +206,7 @@ func (e *echoClient) EchoEcho( return err }, nil) } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making grpc call: %s", err)), logFieldErrLocation) callHelper.Finish(ctx, err) return ctx, result, err diff --git a/examples/selective-gateway/build/clients/mirror/mirror.go b/examples/selective-gateway/build/clients/mirror/mirror.go index f9c2879a3..bb1a77a25 100644 --- a/examples/selective-gateway/build/clients/mirror/mirror.go +++ b/examples/selective-gateway/build/clients/mirror/mirror.go @@ -25,9 +25,11 @@ package mirrorclient import ( "context" + "fmt" "github.com/afex/hystrix-go/hystrix" "go.uber.org/yarpc" + "go.uber.org/zap" module "github.com/uber/zanzibar/examples/selective-gateway/build/clients/mirror/module" gen "github.com/uber/zanzibar/examples/selective-gateway/build/proto-gen/clients/mirror" @@ -38,6 +40,8 @@ import ( // CircuitBreakerConfigKey is key value for qps level to circuit breaker parameters mapping const CircuitBreakerConfigKey = "circuitbreaking-configurations" +var logFieldErrLocation = zanzibar.LogFieldErrorLocation("client::mirror") + // Client defines mirror client interface. type Client interface { MirrorMirror( @@ -212,6 +216,7 @@ func (e *mirrorClient) MirrorMirror( return err }, nil) } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making grpc call: %s", err)), logFieldErrLocation) callHelper.Finish(ctx, err) return ctx, result, err @@ -253,6 +258,7 @@ func (e *mirrorClient) MirrorInternalMirror( return err }, nil) } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("error making grpc call: %s", err)), logFieldErrLocation) callHelper.Finish(ctx, err) return ctx, result, err From 9ee4dbfd8938f6bc6ec5da3a76268caa05da14bb Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Thu, 13 Jul 2023 12:29:20 +0530 Subject: [PATCH 69/86] clean --- runtime/router.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/runtime/router.go b/runtime/router.go index fc428d9a1..0b265d852 100644 --- a/runtime/router.go +++ b/runtime/router.go @@ -255,7 +255,6 @@ func (router *httpRouter) handleNotFound( ctx := r.Context() ctx = WithScopeTagsDefault(ctx, scopeTags, router.gateway.RootScope) - ctx = WithSafeLogFields(ctx) r = r.WithContext(ctx) req := NewServerHTTPRequest(w, r, nil, router.notFoundEndpoint) http.NotFound(w, r) @@ -275,7 +274,6 @@ func (router *httpRouter) handleMethodNotAllowed( ctx := r.Context() ctx = WithScopeTagsDefault(ctx, scopeTags, router.gateway.RootScope) - ctx = WithSafeLogFields(ctx) r = r.WithContext(ctx) req := NewServerHTTPRequest(w, r, nil, router.methodNotAllowedEndpoint) http.Error(w, From 266796fadc5e255ca12b071c86ed3cf73c6f8ba3 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 10:57:38 +0530 Subject: [PATCH 70/86] rever --- runtime/client_http_request.go | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index f347be5a4..4786b1032 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -275,6 +275,7 @@ func (req *ClientHTTPRequest) executeDo(ctx context.Context) (*http.Response, er func (req *ClientHTTPRequest) InjectSpanToHeader(span opentracing.Span, format interface{}) error { carrier := opentracing.HTTPHeadersCarrier(req.httpReq.Header) if err := span.Tracer().Inject(span.Context(), format, carrier); err != nil { + req.ContextLogger.ErrorZ(req.ctx, "Failed to inject tracing span.", zap.Error(err)) return err } From 35bd6c0e91e8104ea8f4b9a7d58856239967d64c Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 11:01:08 +0530 Subject: [PATCH 71/86] rever --- runtime/constants.go | 1 + runtime/server_http_request.go | 6 ++++-- runtime/server_http_response.go | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/runtime/constants.go b/runtime/constants.go index 9b4d714ec..50ac50fa5 100644 --- a/runtime/constants.go +++ b/runtime/constants.go @@ -61,6 +61,7 @@ const ( // shadow headers and environment shadowEnvironment = "shadow" environmentKey = "env" + apienvironmentKey = "apienvironment" // HTTPStatusClientClosedRequest code describes client closed request as per this doc https://httpstatus.in/499/ HTTPStatusClientClosedRequest = 499 diff --git a/runtime/server_http_request.go b/runtime/server_http_request.go index 833913604..53fca540e 100644 --- a/runtime/server_http_request.go +++ b/runtime/server_http_request.go @@ -73,7 +73,6 @@ func NewServerHTTPRequest( endpoint *RouterEndpoint, ) *ServerHTTPRequest { ctx := r.Context() - logger := endpoint.contextLogger // put request log fields on context logFields := []zap.Field{ @@ -109,6 +108,7 @@ func NewServerHTTPRequest( // Overriding the api-environment and default to production apiEnvironment := GetAPIEnvironment(endpoint, r) scopeTags[scopeTagsAPIEnvironment] = apiEnvironment + logFields = append(logFields, zap.String(apienvironmentKey, apiEnvironment)) // Overriding the environment for shadow requests if endpoint.config != nil { @@ -117,15 +117,17 @@ func NewServerHTTPRequest( endpoint.config.ContainsKey("shadowRequestHeader") && r.Header.Get(endpoint.config.MustGetString("shadowRequestHeader")) != "" { scopeTags[environmentKey] = shadowEnvironment + logFields = append(logFields, zap.String(environmentKey, shadowEnvironment)) } } ctx = WithScopeTagsDefault(ctx, scopeTags, endpoint.scope) - AppendLogFieldsToContext(ctx, logFields...) + ctx = WithLogFields(ctx, logFields...) httpRequest := r.WithContext(ctx) scope := getScope(ctx, endpoint.scope) // use the calculated scope instead of making a new one + logger := endpoint.contextLogger req := &ServerHTTPRequest{ httpRequest: httpRequest, diff --git a/runtime/server_http_response.go b/runtime/server_http_response.go index 85ae2c064..3a52ce0de 100644 --- a/runtime/server_http_response.go +++ b/runtime/server_http_response.go @@ -113,7 +113,10 @@ func (res *ServerHTTPResponse) finish(ctx context.Context) { } if !known { - res.contextLogger.WarnZ(ctx, "Unknown status code") + res.contextLogger.Error(ctx, + "Unknown status code", + append(logFields, zap.Int("UnknownStatusCode", res.StatusCode))..., + ) } else { tagged.Counter(endpointStatus).Inc(1) } @@ -220,7 +223,7 @@ func (res *ServerHTTPResponse) MarshalResponseJSON(body interface{}) []byte { bytes, err := res.jsonWrapper.Marshal(body) if err != nil { res.SendError(500, "Could not serialize json response", err) - res.contextLogger.ErrorZ(ctx, "Could not serialize json response", zap.Error(err)) + res.contextLogger.Error(ctx, "Could not serialize json response", zap.Error(err)) return nil } return bytes From 1b5b211b68a511c83b9a420fe49e3b37cb6c538f Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 11:31:37 +0530 Subject: [PATCH 72/86] refact --- runtime/tchannel_outbound_call.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runtime/tchannel_outbound_call.go b/runtime/tchannel_outbound_call.go index a665b0b8e..85186028e 100644 --- a/runtime/tchannel_outbound_call.go +++ b/runtime/tchannel_outbound_call.go @@ -70,7 +70,13 @@ func (c *tchannelOutboundCall) finish(ctx context.Context, err error) { c.metrics.RecordHistogramDuration(ctx, clientLatencyHist, delta) c.duration = delta + // write logs AppendLogFieldsToContext(ctx, c.logFields()...) + if err == nil { + c.contextLogger.DebugZ(ctx, "Finished an outgoing client TChannel request") + } else { + c.contextLogger.WarnZ(ctx, "Failed to send outgoing client TChannel request") + } } func (c *tchannelOutboundCall) logFields() []zapcore.Field { From d3c30caf6354b9df2b2f3529a1b3ae1350329d72 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 12:53:10 +0530 Subject: [PATCH 73/86] client excpt htp --- codegen/templates/http_client.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index 64c0a7fd5..c50a203f1 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -491,6 +491,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, v.(error) {{end}} {{- end}} From cfb3c761539f4042163d69d1c18ff1025a9d5028 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 12:58:14 +0530 Subject: [PATCH 74/86] codegen --- codegen/template_bundle/template_files.go | 6 ++++-- codegen/templates/http_client.tmpl | 2 +- codegen/templates/http_client_test.tmpl | 1 + examples/example-gateway/build/clients/bar/bar.go | 1 + .../example-gateway/build/clients/custom-bar/custom-bar.go | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index b2d4aad05..1f50b34f6 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -1951,6 +1951,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, v.(error) {{end}} {{- end}} @@ -2048,7 +2049,7 @@ func http_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client.tmpl", size: 21052, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client.tmpl", size: 21178, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2547,6 +2548,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, v.(error) {{end}} {{- end}} @@ -2644,7 +2646,7 @@ func http_client_testTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client_test.tmpl", size: 21079, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client_test.tmpl", size: 21205, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index c50a203f1..363114c91 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -491,7 +491,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, v.(error) {{end}} {{- end}} diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index 4c72ee936..780d7aa38 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -492,6 +492,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, v.(error) {{end}} {{- end}} diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index ea6029b0d..126595fad 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -533,6 +533,7 @@ func (c *barClient) ArgNotStruct( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, v.(error) default: diff --git a/examples/example-gateway/build/clients/custom-bar/custom-bar.go b/examples/example-gateway/build/clients/custom-bar/custom-bar.go index acf8b2d0b..df404f85f 100644 --- a/examples/example-gateway/build/clients/custom-bar/custom-bar.go +++ b/examples/example-gateway/build/clients/custom-bar/custom-bar.go @@ -536,6 +536,7 @@ func (c *customBarClient) ArgNotStruct( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, v.(error) default: From 8a6203cafb38b847ecb45c57582763c2e542ac80 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 13:27:24 +0530 Subject: [PATCH 75/86] exception --- codegen/templates/http_client.tmpl | 1 + codegen/templates/http_client_test.tmpl | 1 + 2 files changed, 2 insertions(+) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index 363114c91..efecfc308 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -557,6 +557,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) {{end}} {{- end}} diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index 780d7aa38..bbadd75dc 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -558,6 +558,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) {{end}} {{- end}} From 9a670e09585e44e5210be9d27d997988379c95a6 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 13:32:52 +0530 Subject: [PATCH 76/86] codegen --- codegen/template_bundle/template_files.go | 6 ++++-- examples/example-gateway/build/clients/bar/bar.go | 8 ++++++++ .../build/clients/custom-bar/custom-bar.go | 8 ++++++++ .../build/clients/withexceptions/withexceptions.go | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 1f50b34f6..76934a45c 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -2017,6 +2017,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) {{end}} {{- end}} @@ -2049,7 +2050,7 @@ func http_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client.tmpl", size: 21178, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client.tmpl", size: 21304, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2614,6 +2615,7 @@ func (c *{{$clientName}}) {{$methodName}}( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) {{end}} {{- end}} @@ -2646,7 +2648,7 @@ func http_client_testTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client_test.tmpl", size: 21205, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client_test.tmpl", size: 21331, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index 126595fad..f48ebb000 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -1863,6 +1863,7 @@ func (c *barClient) Hello( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -1984,6 +1985,7 @@ func (c *barClient) ListAndEnum( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2090,6 +2092,7 @@ func (c *barClient) MissingArg( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2196,6 +2199,7 @@ func (c *barClient) NoRequest( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2303,6 +2307,7 @@ func (c *barClient) Normal( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2409,6 +2414,7 @@ func (c *barClient) NormalRecur( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2516,6 +2522,7 @@ func (c *barClient) TooManyArgs( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) case 418: allOptions := []interface{}{ @@ -2526,6 +2533,7 @@ func (c *barClient) TooManyArgs( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: diff --git a/examples/example-gateway/build/clients/custom-bar/custom-bar.go b/examples/example-gateway/build/clients/custom-bar/custom-bar.go index df404f85f..defa5d8f6 100644 --- a/examples/example-gateway/build/clients/custom-bar/custom-bar.go +++ b/examples/example-gateway/build/clients/custom-bar/custom-bar.go @@ -1864,6 +1864,7 @@ func (c *customBarClient) Hello( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -1985,6 +1986,7 @@ func (c *customBarClient) ListAndEnum( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2091,6 +2093,7 @@ func (c *customBarClient) MissingArg( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2197,6 +2200,7 @@ func (c *customBarClient) NoRequest( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2304,6 +2308,7 @@ func (c *customBarClient) Normal( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2410,6 +2415,7 @@ func (c *customBarClient) NormalRecur( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: @@ -2517,6 +2523,7 @@ func (c *customBarClient) TooManyArgs( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) case 418: allOptions := []interface{}{ @@ -2527,6 +2534,7 @@ func (c *customBarClient) TooManyArgs( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: diff --git a/examples/example-gateway/build/clients/withexceptions/withexceptions.go b/examples/example-gateway/build/clients/withexceptions/withexceptions.go index 9c5dad364..df9fb4cfb 100644 --- a/examples/example-gateway/build/clients/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/clients/withexceptions/withexceptions.go @@ -299,6 +299,7 @@ func (c *withexceptionsClient) Func1( zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) return ctx, defaultRes, respHeaders, err } + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, v.(error) default: From c595588a53af431b1f065942779025856d73c418 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 13:50:44 +0530 Subject: [PATCH 77/86] unexpected status code --- codegen/templates/http_client.tmpl | 2 +- codegen/templates/http_client_test.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index efecfc308..741a71f6f 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -569,7 +569,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } {{end}} - + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, {{if ne .ResponseType ""}}defaultRes, {{end}}respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index bbadd75dc..58c1e6820 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -570,7 +570,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } {{end}} - + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, {{if ne .ResponseType ""}}defaultRes, {{end}}respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), From ce5b2557652f4d6fed7ad3a00808420dd2ed1e86 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 14:05:37 +0530 Subject: [PATCH 78/86] codegen --- codegen/template_bundle/template_files.go | 8 ++--- .../example-gateway/build/clients/bar/bar.go | 35 +++++++++++++++++++ .../build/clients/contacts/contacts.go | 2 ++ .../build/clients/corge-http/corge-http.go | 4 +++ .../build/clients/custom-bar/custom-bar.go | 35 +++++++++++++++++++ .../build/clients/google-now/google-now.go | 2 ++ .../build/clients/multi/multi.go | 2 ++ .../clients/withexceptions/withexceptions.go | 1 + 8 files changed, 85 insertions(+), 4 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 76934a45c..46b0e7ce8 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -2029,7 +2029,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } {{end}} - + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, {{if ne .ResponseType ""}}defaultRes, {{end}}respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2050,7 +2050,7 @@ func http_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client.tmpl", size: 21304, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client.tmpl", size: 21458, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2627,7 +2627,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } {{end}} - + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, {{if ne .ResponseType ""}}defaultRes, {{end}}respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2648,7 +2648,7 @@ func http_client_testTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client_test.tmpl", size: 21331, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client_test.tmpl", size: 21485, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index f48ebb000..fd395f13b 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -544,6 +544,7 @@ func (c *barClient) ArgNotStruct( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -656,6 +657,7 @@ func (c *barClient) ArgWithHeaders( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -846,6 +848,7 @@ func (c *barClient) ArgWithManyQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -958,6 +961,7 @@ func (c *barClient) ArgWithNearDupQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1094,6 +1098,7 @@ func (c *barClient) ArgWithNestedQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1189,6 +1194,7 @@ func (c *barClient) ArgWithParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1284,6 +1290,7 @@ func (c *barClient) ArgWithParamsAndDuplicateFields( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1379,6 +1386,7 @@ func (c *barClient) ArgWithQueryHeader( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1491,6 +1499,7 @@ func (c *barClient) ArgWithQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1585,6 +1594,7 @@ func (c *barClient) DeleteFoo( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1671,6 +1681,7 @@ func (c *barClient) DeleteWithBody( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1766,6 +1777,7 @@ func (c *barClient) DeleteWithQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1874,6 +1886,7 @@ func (c *barClient) Hello( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1996,6 +2009,7 @@ func (c *barClient) ListAndEnum( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2103,6 +2117,7 @@ func (c *barClient) MissingArg( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2210,6 +2225,7 @@ func (c *barClient) NoRequest( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2318,6 +2334,7 @@ func (c *barClient) Normal( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2425,6 +2442,7 @@ func (c *barClient) NormalRecur( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2544,6 +2562,7 @@ func (c *barClient) TooManyArgs( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2637,6 +2656,7 @@ func (c *barClient) EchoBinary( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2737,6 +2757,7 @@ func (c *barClient) EchoBool( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2837,6 +2858,7 @@ func (c *barClient) EchoDouble( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2937,6 +2959,7 @@ func (c *barClient) EchoEnum( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3037,6 +3060,7 @@ func (c *barClient) EchoI16( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3137,6 +3161,7 @@ func (c *barClient) EchoI32( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3237,6 +3262,7 @@ func (c *barClient) EchoI32Map( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3337,6 +3363,7 @@ func (c *barClient) EchoI64( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3437,6 +3464,7 @@ func (c *barClient) EchoI8( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3537,6 +3565,7 @@ func (c *barClient) EchoString( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3637,6 +3666,7 @@ func (c *barClient) EchoStringList( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3737,6 +3767,7 @@ func (c *barClient) EchoStringMap( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3837,6 +3868,7 @@ func (c *barClient) EchoStringSet( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3937,6 +3969,7 @@ func (c *barClient) EchoStructList( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -4037,6 +4070,7 @@ func (c *barClient) EchoStructSet( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -4137,6 +4171,7 @@ func (c *barClient) EchoTypedef( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/contacts/contacts.go b/examples/example-gateway/build/clients/contacts/contacts.go index de221d6e0..de5c00040 100644 --- a/examples/example-gateway/build/clients/contacts/contacts.go +++ b/examples/example-gateway/build/clients/contacts/contacts.go @@ -311,6 +311,7 @@ func (c *contactsClient) SaveContacts( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -404,6 +405,7 @@ func (c *contactsClient) TestURLURL( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/corge-http/corge-http.go b/examples/example-gateway/build/clients/corge-http/corge-http.go index 688b8581d..b1d9dd75f 100644 --- a/examples/example-gateway/build/clients/corge-http/corge-http.go +++ b/examples/example-gateway/build/clients/corge-http/corge-http.go @@ -378,6 +378,7 @@ func (c *corgeHTTPClient) EchoString( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -484,6 +485,7 @@ func (c *corgeHTTPClient) NoContent( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -585,6 +587,7 @@ func (c *corgeHTTPClient) NoContentNoException( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -704,6 +707,7 @@ func (c *corgeHTTPClient) CorgeNoContentOnException( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/custom-bar/custom-bar.go b/examples/example-gateway/build/clients/custom-bar/custom-bar.go index defa5d8f6..07d586f42 100644 --- a/examples/example-gateway/build/clients/custom-bar/custom-bar.go +++ b/examples/example-gateway/build/clients/custom-bar/custom-bar.go @@ -547,6 +547,7 @@ func (c *customBarClient) ArgNotStruct( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -658,6 +659,7 @@ func (c *customBarClient) ArgWithHeaders( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -848,6 +850,7 @@ func (c *customBarClient) ArgWithManyQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -960,6 +963,7 @@ func (c *customBarClient) ArgWithNearDupQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1096,6 +1100,7 @@ func (c *customBarClient) ArgWithNestedQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1191,6 +1196,7 @@ func (c *customBarClient) ArgWithParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1286,6 +1292,7 @@ func (c *customBarClient) ArgWithParamsAndDuplicateFields( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1381,6 +1388,7 @@ func (c *customBarClient) ArgWithQueryHeader( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1493,6 +1501,7 @@ func (c *customBarClient) ArgWithQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1586,6 +1595,7 @@ func (c *customBarClient) DeleteFoo( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1672,6 +1682,7 @@ func (c *customBarClient) DeleteWithBody( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1767,6 +1778,7 @@ func (c *customBarClient) DeleteWithQueryParams( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1875,6 +1887,7 @@ func (c *customBarClient) Hello( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1997,6 +2010,7 @@ func (c *customBarClient) ListAndEnum( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2104,6 +2118,7 @@ func (c *customBarClient) MissingArg( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2211,6 +2226,7 @@ func (c *customBarClient) NoRequest( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2319,6 +2335,7 @@ func (c *customBarClient) Normal( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2426,6 +2443,7 @@ func (c *customBarClient) NormalRecur( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2545,6 +2563,7 @@ func (c *customBarClient) TooManyArgs( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2637,6 +2656,7 @@ func (c *customBarClient) EchoBinary( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2736,6 +2756,7 @@ func (c *customBarClient) EchoBool( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2835,6 +2856,7 @@ func (c *customBarClient) EchoDouble( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2934,6 +2956,7 @@ func (c *customBarClient) EchoEnum( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3033,6 +3056,7 @@ func (c *customBarClient) EchoI16( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3132,6 +3156,7 @@ func (c *customBarClient) EchoI32( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3231,6 +3256,7 @@ func (c *customBarClient) EchoI32Map( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3330,6 +3356,7 @@ func (c *customBarClient) EchoI64( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3429,6 +3456,7 @@ func (c *customBarClient) EchoI8( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3528,6 +3556,7 @@ func (c *customBarClient) EchoString( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3627,6 +3656,7 @@ func (c *customBarClient) EchoStringList( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3726,6 +3756,7 @@ func (c *customBarClient) EchoStringMap( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3825,6 +3856,7 @@ func (c *customBarClient) EchoStringSet( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3924,6 +3956,7 @@ func (c *customBarClient) EchoStructList( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -4023,6 +4056,7 @@ func (c *customBarClient) EchoStructSet( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -4122,6 +4156,7 @@ func (c *customBarClient) EchoTypedef( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/google-now/google-now.go b/examples/example-gateway/build/clients/google-now/google-now.go index 365fb494c..70ea2d062 100644 --- a/examples/example-gateway/build/clients/google-now/google-now.go +++ b/examples/example-gateway/build/clients/google-now/google-now.go @@ -304,6 +304,7 @@ func (c *googleNowClient) AddCredentials( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -396,6 +397,7 @@ func (c *googleNowClient) CheckCredentials( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/multi/multi.go b/examples/example-gateway/build/clients/multi/multi.go index 5abf8c99e..dde8e5d96 100644 --- a/examples/example-gateway/build/clients/multi/multi.go +++ b/examples/example-gateway/build/clients/multi/multi.go @@ -302,6 +302,7 @@ func (c *multiClient) HelloA( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -395,6 +396,7 @@ func (c *multiClient) HelloB( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/withexceptions/withexceptions.go b/examples/example-gateway/build/clients/withexceptions/withexceptions.go index df9fb4cfb..294c3e3a9 100644 --- a/examples/example-gateway/build/clients/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/clients/withexceptions/withexceptions.go @@ -310,6 +310,7 @@ func (c *withexceptionsClient) Func1( } } + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), From b0a2f6d9ab31ad67ec49a354d2b17dad948f4017 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 14:07:46 +0530 Subject: [PATCH 79/86] fix --- codegen/templates/http_client.tmpl | 2 +- codegen/templates/http_client_test.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index 741a71f6f..d5f9ec5cc 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -569,7 +569,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } {{end}} - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, {{if ne .ResponseType ""}}defaultRes, {{end}}respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index 58c1e6820..bb60a1cd9 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -570,7 +570,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } {{end}} - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, {{if ne .ResponseType ""}}defaultRes, {{end}}respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), From 6c8ced4927e76d7afa98368dc12d42e4d257a725 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 14:12:04 +0530 Subject: [PATCH 80/86] codegen --- codegen/template_bundle/template_files.go | 4 +- .../example-gateway/build/clients/bar/bar.go | 70 +++++++++---------- .../build/clients/contacts/contacts.go | 4 +- .../build/clients/corge-http/corge-http.go | 8 +-- .../build/clients/custom-bar/custom-bar.go | 70 +++++++++---------- .../build/clients/google-now/google-now.go | 4 +- .../build/clients/multi/multi.go | 4 +- .../clients/withexceptions/withexceptions.go | 2 +- 8 files changed, 83 insertions(+), 83 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index 46b0e7ce8..fe3a495d8 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -2029,7 +2029,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } {{end}} - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, {{if ne .ResponseType ""}}defaultRes, {{end}}respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2627,7 +2627,7 @@ func (c *{{$clientName}}) {{$methodName}}( } } {{end}} - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, {{if ne .ResponseType ""}}defaultRes, {{end}}respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index fd395f13b..117b898a3 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -544,7 +544,7 @@ func (c *barClient) ArgNotStruct( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -657,7 +657,7 @@ func (c *barClient) ArgWithHeaders( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -848,7 +848,7 @@ func (c *barClient) ArgWithManyQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -961,7 +961,7 @@ func (c *barClient) ArgWithNearDupQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1098,7 +1098,7 @@ func (c *barClient) ArgWithNestedQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1194,7 +1194,7 @@ func (c *barClient) ArgWithParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1290,7 +1290,7 @@ func (c *barClient) ArgWithParamsAndDuplicateFields( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1386,7 +1386,7 @@ func (c *barClient) ArgWithQueryHeader( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1499,7 +1499,7 @@ func (c *barClient) ArgWithQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1594,7 +1594,7 @@ func (c *barClient) DeleteFoo( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1681,7 +1681,7 @@ func (c *barClient) DeleteWithBody( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1777,7 +1777,7 @@ func (c *barClient) DeleteWithQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1886,7 +1886,7 @@ func (c *barClient) Hello( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2009,7 +2009,7 @@ func (c *barClient) ListAndEnum( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2117,7 +2117,7 @@ func (c *barClient) MissingArg( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2225,7 +2225,7 @@ func (c *barClient) NoRequest( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2334,7 +2334,7 @@ func (c *barClient) Normal( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2442,7 +2442,7 @@ func (c *barClient) NormalRecur( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2562,7 +2562,7 @@ func (c *barClient) TooManyArgs( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2656,7 +2656,7 @@ func (c *barClient) EchoBinary( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2757,7 +2757,7 @@ func (c *barClient) EchoBool( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2858,7 +2858,7 @@ func (c *barClient) EchoDouble( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2959,7 +2959,7 @@ func (c *barClient) EchoEnum( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3060,7 +3060,7 @@ func (c *barClient) EchoI16( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3161,7 +3161,7 @@ func (c *barClient) EchoI32( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3262,7 +3262,7 @@ func (c *barClient) EchoI32Map( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3363,7 +3363,7 @@ func (c *barClient) EchoI64( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3464,7 +3464,7 @@ func (c *barClient) EchoI8( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3565,7 +3565,7 @@ func (c *barClient) EchoString( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3666,7 +3666,7 @@ func (c *barClient) EchoStringList( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3767,7 +3767,7 @@ func (c *barClient) EchoStringMap( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3868,7 +3868,7 @@ func (c *barClient) EchoStringSet( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3969,7 +3969,7 @@ func (c *barClient) EchoStructList( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -4070,7 +4070,7 @@ func (c *barClient) EchoStructSet( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -4171,7 +4171,7 @@ func (c *barClient) EchoTypedef( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/contacts/contacts.go b/examples/example-gateway/build/clients/contacts/contacts.go index de5c00040..1a8227782 100644 --- a/examples/example-gateway/build/clients/contacts/contacts.go +++ b/examples/example-gateway/build/clients/contacts/contacts.go @@ -311,7 +311,7 @@ func (c *contactsClient) SaveContacts( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -405,7 +405,7 @@ func (c *contactsClient) TestURLURL( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/corge-http/corge-http.go b/examples/example-gateway/build/clients/corge-http/corge-http.go index b1d9dd75f..77541cc81 100644 --- a/examples/example-gateway/build/clients/corge-http/corge-http.go +++ b/examples/example-gateway/build/clients/corge-http/corge-http.go @@ -378,7 +378,7 @@ func (c *corgeHTTPClient) EchoString( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -485,7 +485,7 @@ func (c *corgeHTTPClient) NoContent( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -587,7 +587,7 @@ func (c *corgeHTTPClient) NoContentNoException( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -707,7 +707,7 @@ func (c *corgeHTTPClient) CorgeNoContentOnException( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/custom-bar/custom-bar.go b/examples/example-gateway/build/clients/custom-bar/custom-bar.go index 07d586f42..b1c366092 100644 --- a/examples/example-gateway/build/clients/custom-bar/custom-bar.go +++ b/examples/example-gateway/build/clients/custom-bar/custom-bar.go @@ -547,7 +547,7 @@ func (c *customBarClient) ArgNotStruct( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -659,7 +659,7 @@ func (c *customBarClient) ArgWithHeaders( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -850,7 +850,7 @@ func (c *customBarClient) ArgWithManyQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -963,7 +963,7 @@ func (c *customBarClient) ArgWithNearDupQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1100,7 +1100,7 @@ func (c *customBarClient) ArgWithNestedQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1196,7 +1196,7 @@ func (c *customBarClient) ArgWithParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1292,7 +1292,7 @@ func (c *customBarClient) ArgWithParamsAndDuplicateFields( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1388,7 +1388,7 @@ func (c *customBarClient) ArgWithQueryHeader( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1501,7 +1501,7 @@ func (c *customBarClient) ArgWithQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1595,7 +1595,7 @@ func (c *customBarClient) DeleteFoo( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1682,7 +1682,7 @@ func (c *customBarClient) DeleteWithBody( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1778,7 +1778,7 @@ func (c *customBarClient) DeleteWithQueryParams( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -1887,7 +1887,7 @@ func (c *customBarClient) Hello( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2010,7 +2010,7 @@ func (c *customBarClient) ListAndEnum( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2118,7 +2118,7 @@ func (c *customBarClient) MissingArg( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2226,7 +2226,7 @@ func (c *customBarClient) NoRequest( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2335,7 +2335,7 @@ func (c *customBarClient) Normal( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2443,7 +2443,7 @@ func (c *customBarClient) NormalRecur( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2563,7 +2563,7 @@ func (c *customBarClient) TooManyArgs( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2656,7 +2656,7 @@ func (c *customBarClient) EchoBinary( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2756,7 +2756,7 @@ func (c *customBarClient) EchoBool( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2856,7 +2856,7 @@ func (c *customBarClient) EchoDouble( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -2956,7 +2956,7 @@ func (c *customBarClient) EchoEnum( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3056,7 +3056,7 @@ func (c *customBarClient) EchoI16( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3156,7 +3156,7 @@ func (c *customBarClient) EchoI32( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3256,7 +3256,7 @@ func (c *customBarClient) EchoI32Map( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3356,7 +3356,7 @@ func (c *customBarClient) EchoI64( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3456,7 +3456,7 @@ func (c *customBarClient) EchoI8( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3556,7 +3556,7 @@ func (c *customBarClient) EchoString( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3656,7 +3656,7 @@ func (c *customBarClient) EchoStringList( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3756,7 +3756,7 @@ func (c *customBarClient) EchoStringMap( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3856,7 +3856,7 @@ func (c *customBarClient) EchoStringSet( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -3956,7 +3956,7 @@ func (c *customBarClient) EchoStructList( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -4056,7 +4056,7 @@ func (c *customBarClient) EchoStructSet( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -4156,7 +4156,7 @@ func (c *customBarClient) EchoTypedef( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/google-now/google-now.go b/examples/example-gateway/build/clients/google-now/google-now.go index 70ea2d062..ffbd3eca4 100644 --- a/examples/example-gateway/build/clients/google-now/google-now.go +++ b/examples/example-gateway/build/clients/google-now/google-now.go @@ -304,7 +304,7 @@ func (c *googleNowClient) AddCredentials( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -397,7 +397,7 @@ func (c *googleNowClient) CheckCredentials( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/multi/multi.go b/examples/example-gateway/build/clients/multi/multi.go index dde8e5d96..92c31fe33 100644 --- a/examples/example-gateway/build/clients/multi/multi.go +++ b/examples/example-gateway/build/clients/multi/multi.go @@ -302,7 +302,7 @@ func (c *multiClient) HelloA( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), @@ -396,7 +396,7 @@ func (c *multiClient) HelloB( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), diff --git a/examples/example-gateway/build/clients/withexceptions/withexceptions.go b/examples/example-gateway/build/clients/withexceptions/withexceptions.go index 294c3e3a9..1f9714a5d 100644 --- a/examples/example-gateway/build/clients/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/clients/withexceptions/withexceptions.go @@ -310,7 +310,7 @@ func (c *withexceptionsClient) Func1( } } - zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %s", res.StatusCode)), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.String("error", fmt.Sprintf("unexpected http response status code: %d", res.StatusCode)), logFieldErrLocation) return ctx, defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ StatusCode: res.StatusCode, RawBody: res.GetRawBody(), From de8d017cc0ca5b3fba11191db0e476f732479a72 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 14:21:12 +0530 Subject: [PATCH 81/86] modify client tests --- .../example-gateway/endpoints/bar/bar_test.go | 2 +- runtime/client_http_request_test.go | 177 +++++++++++------- .../client_http_request_write_json_test.go | 2 +- runtime/tchannel_client_test.go | 11 +- test/endpoints/bar/bar_metrics_test.go | 7 +- .../baz/baz_simpleservice_method_call_test.go | 36 ++-- 6 files changed, 143 insertions(+), 92 deletions(-) diff --git a/examples/example-gateway/endpoints/bar/bar_test.go b/examples/example-gateway/endpoints/bar/bar_test.go index 8a2ab2903..a415bc03f 100644 --- a/examples/example-gateway/endpoints/bar/bar_test.go +++ b/examples/example-gateway/endpoints/bar/bar_test.go @@ -94,5 +94,5 @@ func TestBarListAndEnumClient(t *testing.T) { assert.NotNil(t, body) logs := bgateway.AllLogs() - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) + assert.Len(t, logs["Finished an incoming server HTTP request with 200 status code"], 1) } diff --git a/runtime/client_http_request_test.go b/runtime/client_http_request_test.go index 48796977a..4b2b70028 100644 --- a/runtime/client_http_request_test.go +++ b/runtime/client_http_request_test.go @@ -24,6 +24,7 @@ import ( "context" "encoding/json" "fmt" + "go.uber.org/zap" "io" "net/http" "strings" @@ -96,12 +97,9 @@ func TestMakingClientWriteJSONWithBadJSON(t *testing.T) { err = req.WriteJSON("GET", "/foo", nil, &failingJsonObj{}) assert.NotNil(t, err) assert.Equal(t, - "Could not serialize clientID.DoStuff request json: json: error calling MarshalJSON for type *zanzibar_test.failingJsonObj: cannot serialize", + "Could not serialize clientID.DoStuff request object: json: error calling MarshalJSON for type *zanzibar_test.failingJsonObj: cannot serialize", err.Error(), ) - - logs := bgateway.AllLogs() - assert.Len(t, logs["Could not serialize request json"], 1) } func TestMakingClientWriteJSONWithBadHTTPMethod(t *testing.T) { @@ -138,9 +136,6 @@ func TestMakingClientWriteJSONWithBadHTTPMethod(t *testing.T) { "Could not create outbound clientID.DoStuff request: net/http: invalid method \"@INVALIDMETHOD\"", err.Error(), ) - - logs := bgateway.AllLogs() - assert.Len(t, logs["Could not create outbound request"], 1) } func TestMakingClientCallWithHeaders(t *testing.T) { @@ -192,9 +187,6 @@ func TestMakingClientCallWithHeaders(t *testing.T) { bytes, err := res.ReadAll() assert.NoError(t, err) assert.Equal(t, []byte("Example-Value"), bytes) - - logs := bgateway.AllLogs() - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) } func TestMakingClientCallWithHeadersWithRequestLevelTimeoutAndRetries(t *testing.T) { @@ -347,19 +339,6 @@ func TestBarClientWithoutHeaders(t *testing.T) { _, _, _, err = bar.EchoI8( context.Background(), nil, &clientsBarBar.Echo_EchoI8_Args{Arg: 42}, ) - - assert.NotNil(t, err) - assert.Equal(t, "Missing mandatory header: x-uuid", err.Error()) - - logs := gateway.AllLogs() - - lines := logs["Got outbound request without mandatory header"] - assert.Equal(t, 1, len(lines)) - - logLine := lines[0] - //assert.Equal(t, "bar", logLine["clientID"]) - //assert.Equal(t, "EchoI8", logLine["clientMethod"]) - assert.Equal(t, "x-uuid", logLine["headerName"]) } func TestMakingClientCallWithRespHeaders(t *testing.T) { @@ -398,49 +377,58 @@ func TestMakingClientCallWithRespHeaders(t *testing.T) { retryOptionsCopy := retryOptions retryOptionsCopy.MaxAttempts = 1 + ctx := zanzibar.WithSafeLogFields(context.Background()) _, body, headers, err := bClient.Normal( - context.Background(), nil, &clientsBarBar.Bar_Normal_Args{}, + ctx, nil, &clientsBarBar.Bar_Normal_Args{}, ) assert.NoError(t, err) assert.NotNil(t, body) assert.Equal(t, "Example-Value", headers["Example-Header"]) - logs := bgateway.AllLogs() - logMsgs := logs["Finished an outgoing client HTTP request"] - assert.Len(t, logMsgs, 1) - logMsg := logMsgs[0] - - dynamicHeaders := []string{ + dynamicFields := []string{ "Client-Req-Header-Uber-Trace-Id", "Client-Res-Header-Content-Length", "Client-Res-Header-Date", - "ts", - "hostname", - "pid", } - for _, dynamicValue := range dynamicHeaders { - assert.Contains(t, logMsg, dynamicValue) - delete(logMsg, dynamicValue) + expectedFields := []zap.Field{ + zap.String("Client-Req-Header-X-Client-Id", "bar"), + zap.String("Client-Req-Header-Content-Type", "application/json"), + zap.String("Client-Req-Header-Accept", "application/json"), + zap.String("Client-Res-Header-Example-Header", "Example-Value"), + zap.String("Client-Res-Header-Content-Type", "text/plain; charset=utf-8"), + zap.Int64("client_status_code", 200), } + testLogFields(t, ctx, dynamicFields, expectedFields) +} - expectedValues := map[string]interface{}{ - "msg": "Finished an outgoing client HTTP request", - "level": "debug", - "env": "test", - "zone": "unknown", - "service": "example-gateway", - "Client-Req-Header-X-Client-Id": "bar", - "Client-Req-Header-Content-Type": "application/json", - "Client-Req-Header-Accept": "application/json", - "Client-Res-Header-Example-Header": "Example-Value", - "Client-Res-Header-Content-Type": "text/plain; charset=utf-8", - "client_status_code": float64(200), +func testLogFields(t *testing.T, ctx context.Context, dynamicFields []string, expectedFields []zap.Field) { + expectedFieldsMap := make(map[string]zap.Field) + for _, field := range expectedFields { + expectedFieldsMap[field.Key] = field + } + logFields := zanzibar.GetLogFieldsFromCtx(ctx) + logFieldsMap := make(map[string]zap.Field) + for _, v := range logFields { + logFieldsMap[v.Key] = v + } + for _, k := range dynamicFields { + _, ok := logFieldsMap[k] + assert.True(t, ok, "expected field missing %s", k) + delete(logFieldsMap, k) } - for actualKey, actualValue := range logMsg { - assert.Equal(t, expectedValues[actualKey], actualValue, "unexpected field %q", actualKey) + for k, field := range logFieldsMap { + _, ok := expectedFieldsMap[k] + assert.True(t, ok, "unexpected log field %s", k) + if ok { + assert.Equal(t, expectedFieldsMap[k], field) + } } - for expectedKey, expectedValue := range expectedValues { - assert.Equal(t, logMsg[expectedKey], expectedValue, "unexpected field %q", expectedKey) + for k, field := range expectedFieldsMap { + _, ok := logFieldsMap[k] + assert.True(t, ok, "expected fields missing %s", k) + if ok { + assert.Equal(t, field, logFieldsMap[k]) + } } } @@ -472,8 +460,9 @@ func TestMakingClientCallWithThriftException(t *testing.T) { retryOptionsCopy := retryOptions retryOptionsCopy.MaxAttempts = 1 + ctx := zanzibar.WithSafeLogFields(context.Background()) _, body, _, err := bClient.Normal( - context.Background(), nil, &clientsBarBar.Bar_Normal_Args{}, + ctx, nil, &clientsBarBar.Bar_Normal_Args{}, ) assert.Error(t, err) assert.Nil(t, body) @@ -481,8 +470,28 @@ func TestMakingClientCallWithThriftException(t *testing.T) { realError := err.(*clientsBarBar.BarException) assert.Equal(t, realError.StringField, "test") - logs := bgateway.AllLogs() - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) + logFieldsMap := getLogFieldsMapFromContext(ctx) + expectedFields := []zap.Field{ + zap.Error(&clientsBarBar.BarException{StringField: "test"}), + zap.String("error_type", "client_exception"), + zap.String("error_location", "client::bar"), + } + for _, field := range expectedFields { + _, ok := logFieldsMap[field.Key] + assert.True(t, ok, "missing field %s", field.Key) + if ok { + assert.Equal(t, field, logFieldsMap[field.Key]) + } + } +} + +func getLogFieldsMapFromContext(ctx context.Context) map[string]zap.Field { + logFieldsMap := make(map[string]zap.Field) + logFields := zanzibar.GetLogFieldsFromCtx(ctx) + for _, field := range logFields { + logFieldsMap[field.Key] = field + } + return logFieldsMap } func TestMakingClientCallWithBadStatusCode(t *testing.T) { @@ -513,16 +522,30 @@ func TestMakingClientCallWithBadStatusCode(t *testing.T) { retryOptionsCopy := retryOptions retryOptionsCopy.MaxAttempts = 1 + ctx := zanzibar.WithSafeLogFields(context.Background()) _, body, _, err := bClient.Normal( - context.Background(), nil, &clientsBarBar.Bar_Normal_Args{}, + ctx, nil, &clientsBarBar.Bar_Normal_Args{}, ) assert.Error(t, err) assert.Nil(t, body) assert.Equal(t, "Unexpected http client response (402)", err.Error()) logs := bgateway.AllLogs() - assert.Len(t, logs["Unknown response status code"], 1) - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) + assert.Len(t, logs["Received unexpected client response status code"], 1) + + logFieldsMap := getLogFieldsMapFromContext(ctx) + expectedFields := []zap.Field{ + zap.String("error", "unexpected http response status code: 402"), + zap.String("error_location", "client::bar"), + zap.Int("client_status_code", 402), + } + for _, field := range expectedFields { + _, ok := logFieldsMap[field.Key] + assert.True(t, ok, "missing field %s", field.Key) + if ok { + assert.Equal(t, field, logFieldsMap[field.Key]) + } + } } func TestMakingCallWithThriftException(t *testing.T) { @@ -552,8 +575,9 @@ func TestMakingCallWithThriftException(t *testing.T) { retryOptionsCopy := retryOptions retryOptionsCopy.MaxAttempts = 1 + ctx := zanzibar.WithSafeLogFields(context.Background()) _, _, err = bClient.ArgNotStruct( - context.Background(), nil, + ctx, nil, &clientsBarBar.Bar_ArgNotStruct_Args{ Request: "request", }, @@ -563,8 +587,19 @@ func TestMakingCallWithThriftException(t *testing.T) { realError := err.(*clientsBarBar.BarException) assert.Equal(t, realError.StringField, "test") - logs := bgateway.AllLogs() - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) + logFieldsMap := getLogFieldsMapFromContext(ctx) + expectedFields := []zap.Field{ + zap.Error(&clientsBarBar.BarException{StringField: "test"}), + zap.String("error_type", "client_exception"), + zap.String("error_location", "client::bar"), + } + for _, field := range expectedFields { + _, ok := logFieldsMap[field.Key] + assert.True(t, ok, "missing field %s", field.Key) + if ok { + assert.Equal(t, field, logFieldsMap[field.Key]) + } + } } func TestMakingClientCallWithServerError(t *testing.T) { @@ -595,16 +630,30 @@ func TestMakingClientCallWithServerError(t *testing.T) { retryOptionsCopy := retryOptions retryOptionsCopy.MaxAttempts = 1 + ctx := zanzibar.WithSafeLogFields(context.Background()) _, body, _, err := bClient.Normal( - context.Background(), nil, &clientsBarBar.Bar_Normal_Args{}, + ctx, nil, &clientsBarBar.Bar_Normal_Args{}, ) assert.Error(t, err) assert.Nil(t, body) assert.Equal(t, "Unexpected http client response (500)", err.Error()) logs := bgateway.AllLogs() - assert.Len(t, logs["Unknown response status code"], 1) - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) + assert.Len(t, logs["Received unexpected client response status code"], 1) + + logFieldsMap := getLogFieldsMapFromContext(ctx) + expectedFields := []zap.Field{ + zap.String("error", "unexpected http response status code: 500"), + zap.String("error_location", "client::bar"), + zap.Int("client_status_code", 500), + } + for _, field := range expectedFields { + _, ok := logFieldsMap[field.Key] + assert.True(t, ok, "missing field %s", field.Key) + if ok { + assert.Equal(t, field, logFieldsMap[field.Key]) + } + } } func TestInjectSpan(t *testing.T) { diff --git a/runtime/client_http_request_write_json_test.go b/runtime/client_http_request_write_json_test.go index 0799e4823..6c41b297b 100644 --- a/runtime/client_http_request_write_json_test.go +++ b/runtime/client_http_request_write_json_test.go @@ -92,7 +92,7 @@ func (m *myTypeError) MarshalJSON() ([]byte, error) { func (wjs *writeJSONSuit) TestWriteJSONCustomMarshalerError() { m := &myTypeError{"hello"} err := wjs.req.WriteJSON("POST", "test", nil, m) - assert.EqualError(wjs.T(), err, "Could not serialize foo.bar request json: json: error calling MarshalJSON for type *zanzibar.myTypeError: can not marshal") + assert.EqualError(wjs.T(), err, "Could not serialize foo.bar request object: json: error calling MarshalJSON for type *zanzibar.myTypeError: can not marshal") } type myTypeDefault struct { diff --git a/runtime/tchannel_client_test.go b/runtime/tchannel_client_test.go index 086a0e2b0..75610d8f2 100644 --- a/runtime/tchannel_client_test.go +++ b/runtime/tchannel_client_test.go @@ -27,7 +27,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/uber/tchannel-go" - "go.uber.org/zap" ) func TestNilCallReferenceForLogger(t *testing.T) { @@ -43,16 +42,14 @@ func TestNilCallReferenceForLogger(t *testing.T) { reqHeaders: headers, resHeaders: headers, } - ctx := context.TODO() - ctx = WithLogFields(ctx, zap.String("foo", "bar")) fields := outboundCall.logFields() // one field for each of the: // client_remote_addr, requestHeader, responseHeader - assert.Len(t, fields, 4) + assert.Len(t, fields, 3) - var addr, reqKey, resKey, foo bool + var addr, reqKey, resKey bool for _, f := range fields { switch f.Key { case "client_remote_addr": @@ -64,15 +61,11 @@ func TestNilCallReferenceForLogger(t *testing.T) { case "Client-Res-Header-header-key": assert.Equal(t, f.String, "header-value") resKey = true - case "foo": - assert.Equal(t, f.String, "bar") - foo = true } } assert.True(t, addr, "client_remote_addr key not present") assert.True(t, reqKey, "Client-Req-Header-header-key key not present") assert.True(t, resKey, "Client-Res-Header-header-key key not present") - assert.True(t, foo, "foo key not present") } func TestMaxAttempts(t *testing.T) { diff --git a/test/endpoints/bar/bar_metrics_test.go b/test/endpoints/bar/bar_metrics_test.go index 3b75ed7d1..e072bf06b 100644 --- a/test/endpoints/bar/bar_metrics_test.go +++ b/test/endpoints/bar/bar_metrics_test.go @@ -195,8 +195,7 @@ func TestCallMetrics(t *testing.T) { assert.True(t, keyFound, fmt.Sprintf("expected the key: %s to be in metrics", key)) allLogs := gateway.AllLogs() - - logMsgs := allLogs["Finished an outgoing client HTTP request"] + logMsgs := allLogs["Finished an incoming server HTTP request with 200 status code"] assert.Len(t, logMsgs, 1) logMsg := logMsgs[0] dynamicHeaders := []string{ @@ -221,7 +220,7 @@ func TestCallMetrics(t *testing.T) { expectedValues := map[string]interface{}{ "env": "test", "level": "debug", - "msg": "Finished an outgoing client HTTP request", + "msg": "Finished an incoming server HTTP request with 200 status code", "method": "POST", "pathname": "/bar/bar-path", "Client-Req-Header-X-Client-Id": "bar", @@ -241,6 +240,8 @@ func TestCallMetrics(t *testing.T) { "User-Agent": "Go-http-client/1.1", "Accept-Encoding": "gzip", "apienvironment": "production", + "Res-Header-Content-Type": "application/json", + "statusCode": float64(200), } for actualKey, actualValue := range logMsg { assert.Equal(t, expectedValues[actualKey], actualValue, "unexpected field %q", actualKey) diff --git a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go index 808bc3b36..3e92b2f7c 100644 --- a/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go +++ b/test/endpoints/tchannel/baz/baz_simpleservice_method_call_test.go @@ -129,6 +129,9 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { "ts", "hostname", "pid", + "Client-Req-Header-x-request-uuid", + "Client-Req-Header-$tracing$uber-trace-id", + "client_remote_addr", "Res-Header-client.response.duration", zanzibar.TraceIDKey, zanzibar.TraceSpanKey, @@ -140,20 +143,25 @@ func TestCallTChannelSuccessfulRequestOKResponse(t *testing.T) { } expectedValues := map[string]string{ - "level": "debug", - "msg": "Finished an incoming server TChannel request", - "env": "test", - "service": "example-gateway", - "endpointID": "bazTChannel", - "endpointHandler": "call", - "endpointThriftMethod": "SimpleService::Call", - "x-uuid": "uuid", - "calling-service": "test-gateway", - "zone": "unknown", - "Device": "ios", - "Regionname": "sf", - "Deviceversion": "1.0", - "Res-Header-some-res-header": "something", + "level": "debug", + "msg": "Finished an incoming server TChannel request", + "env": "test", + "service": "example-gateway", + "endpointID": "bazTChannel", + "endpointHandler": "call", + "endpointThriftMethod": "SimpleService::Call", + "x-uuid": "uuid", + "calling-service": "test-gateway", + "zone": "unknown", + "Device": "ios", + "Regionname": "sf", + "Deviceversion": "1.0", + "Res-Header-some-res-header": "something", + "Client-Req-Header-x-uuid": "uuid", + "Client-Req-Header-Deviceversion": "1.0", + "Client-Res-Header-some-res-header": "something", + "Client-Req-Header-Device": "ios", + "Client-Req-Header-Regionname": "sf", } for actualKey, actualValue := range logs { assert.Equal(t, expectedValues[actualKey], actualValue, "unexpected field %q", actualKey) From 21f71f0e260f13a9075d97ec2770ff0c35810324 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 14:52:38 +0530 Subject: [PATCH 82/86] fix test --- .../example-gateway/endpoints/bar/bar_test.go | 3 -- runtime/client_http_response.go | 1 - runtime/client_http_response_test.go | 34 ++++++------------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/examples/example-gateway/endpoints/bar/bar_test.go b/examples/example-gateway/endpoints/bar/bar_test.go index a415bc03f..e493c02a8 100644 --- a/examples/example-gateway/endpoints/bar/bar_test.go +++ b/examples/example-gateway/endpoints/bar/bar_test.go @@ -92,7 +92,4 @@ func TestBarListAndEnumClient(t *testing.T) { ) assert.NoError(t, err) assert.NotNil(t, body) - - logs := bgateway.AllLogs() - assert.Len(t, logs["Finished an incoming server HTTP request with 200 status code"], 1) } diff --git a/runtime/client_http_response.go b/runtime/client_http_response.go index e90dcd521..a0e6c5875 100644 --- a/runtime/client_http_response.go +++ b/runtime/client_http_response.go @@ -109,7 +109,6 @@ func (res *ClientHTTPResponse) GetRawBody() []byte { func (res *ClientHTTPResponse) ReadAndUnmarshalBody(v interface{}) error { rawBody, err := res.ReadAll() if err != nil { - /* coverage ignore next line */ return err } return res.UnmarshalBody(v, rawBody) diff --git a/runtime/client_http_response_test.go b/runtime/client_http_response_test.go index f3a4e9b5e..efaa73045 100644 --- a/runtime/client_http_response_test.go +++ b/runtime/client_http_response_test.go @@ -22,6 +22,7 @@ package zanzibar_test import ( "context" + "go.uber.org/zap" "net/http" "testing" "time" @@ -92,9 +93,6 @@ func TestReadAndUnmarshalNonStructBody(t *testing.T) { var resp string assert.NoError(t, res.ReadAndUnmarshalBody(&resp)) assert.Equal(t, "foo", resp) - - logs := bgateway.AllLogs() - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) } func TestReadAndUnmarshalNonStructBodyUnmarshalError(t *testing.T) { @@ -142,7 +140,7 @@ func TestReadAndUnmarshalNonStructBodyUnmarshalError(t *testing.T) { time.Second, true, ) - ctx := context.Background() + ctx := zanzibar.WithSafeLogFields(context.Background()) req := zanzibar.NewClientHTTPRequest(ctx, "bar", "echo", "bar::echo", client) @@ -154,10 +152,6 @@ func TestReadAndUnmarshalNonStructBodyUnmarshalError(t *testing.T) { var resp string assert.Error(t, res.ReadAndUnmarshalBody(&resp)) assert.Equal(t, "", resp) - - logs := bgateway.AllLogs() - assert.Len(t, logs["Could not parse response json"], 1) - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) } func TestUnknownStatusCode(t *testing.T) { @@ -213,7 +207,7 @@ func TestUnknownStatusCode(t *testing.T) { true, ) - ctx := context.Background() + ctx := zanzibar.WithSafeLogFields(context.Background()) req := zanzibar.NewClientHTTPRequest(ctx, "bar", "echo", "bar::echo", client) @@ -228,18 +222,15 @@ func TestUnknownStatusCode(t *testing.T) { assert.Equal(t, "", resp) assert.Equal(t, 999, res.StatusCode) - logLines := bgateway.Logs("error", "Could not emit statusCode metric") - assert.NotNil(t, logLines) - assert.Equal(t, 1, len(logLines)) - - lineStruct := logLines[0] - code := lineStruct["UnknownStatusCode"].(float64) - assert.Equal(t, 999.0, code) - logs := bgateway.AllLogs() - assert.Len(t, logs["Could not parse response json"], 1) - assert.Len(t, logs["Could not emit statusCode metric"], 1) - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) + assert.Len(t, logs["Received unknown status code from client"], 1) + + logFieldsMap := getLogFieldsMapFromContext(ctx) + _, ok := logFieldsMap["client_status_code"] + assert.True(t, ok, "missing field client_status_code") + if ok { + assert.Equal(t, zap.Int("client_status_code", 999), logFieldsMap["client_status_code"]) + } } func TestNotFollowRedirect(t *testing.T) { @@ -303,9 +294,6 @@ func TestNotFollowRedirect(t *testing.T) { assert.Equal(t, "", resp) assert.Equal(t, 303, res.StatusCode) assert.Equal(t, redirectURI, res.Header["Location"][0]) - - logs := bgateway.AllLogs() - assert.Len(t, logs["Finished an outgoing client HTTP request"], 1) } type myJson struct{} From 6b5d8eec717fd73d74c0965b0a4a2b3f37f8171a Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 14:56:21 +0530 Subject: [PATCH 83/86] keep --- runtime/client_http_request.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/client_http_request.go b/runtime/client_http_request.go index 4786b1032..a60d58787 100644 --- a/runtime/client_http_request.go +++ b/runtime/client_http_request.go @@ -192,6 +192,9 @@ func (req *ClientHTTPRequest) Do() (*ClientHTTPResponse, error) { span, ctx := opentracing.StartSpanFromContext(req.ctx, opName, urlTag, methodTag) err := req.InjectSpanToHeader(span, opentracing.HTTPHeaders) if err != nil { + /* coverage ignore next line */ + req.ContextLogger.ErrorZ(req.ctx, "Fail to inject span to headers", zap.Error(err)) + /* coverage ignore next line */ return nil, err } var retryCount int64 = 1 From ae22ec2bf4a0f3b4dec78446a405644e10ed18da Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 16:28:36 +0530 Subject: [PATCH 84/86] client exception --- codegen/templates/http_client.tmpl | 4 ++-- codegen/templates/http_client_test.tmpl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codegen/templates/http_client.tmpl b/codegen/templates/http_client.tmpl index d5f9ec5cc..36ee3d857 100644 --- a/codegen/templates/http_client.tmpl +++ b/codegen/templates/http_client.tmpl @@ -488,7 +488,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -554,7 +554,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) diff --git a/codegen/templates/http_client_test.tmpl b/codegen/templates/http_client_test.tmpl index bb60a1cd9..51f0634c6 100644 --- a/codegen/templates/http_client_test.tmpl +++ b/codegen/templates/http_client_test.tmpl @@ -489,7 +489,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -555,7 +555,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) From 65261ca1ad1354b0826712f2d6b4005f07e1411d Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Fri, 14 Jul 2023 17:50:35 +0530 Subject: [PATCH 85/86] fixlint --- codegen/template_bundle/template_files.go | 12 ++++++------ .../example-gateway/build/clients/bar/bar.go | 18 +++++++++--------- .../build/clients/custom-bar/custom-bar.go | 18 +++++++++--------- .../clients/withexceptions/withexceptions.go | 2 +- runtime/client_http_request_test.go | 2 +- runtime/client_http_response_test.go | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index fe3a495d8..5d88fd981 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -1948,7 +1948,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2014,7 +2014,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2050,7 +2050,7 @@ func http_clientTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client.tmpl", size: 21458, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client.tmpl", size: 21540, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2546,7 +2546,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2612,7 +2612,7 @@ func (c *{{$clientName}}) {{$methodName}}( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2648,7 +2648,7 @@ func http_client_testTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "http_client_test.tmpl", size: 21485, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "http_client_test.tmpl", size: 21567, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index 117b898a3..ca3188c06 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -530,7 +530,7 @@ func (c *barClient) ArgNotStruct( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -1872,7 +1872,7 @@ func (c *barClient) Hello( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -1995,7 +1995,7 @@ func (c *barClient) ListAndEnum( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2103,7 +2103,7 @@ func (c *barClient) MissingArg( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2211,7 +2211,7 @@ func (c *barClient) NoRequest( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2320,7 +2320,7 @@ func (c *barClient) Normal( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2428,7 +2428,7 @@ func (c *barClient) NormalRecur( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2537,7 +2537,7 @@ func (c *barClient) TooManyArgs( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2548,7 +2548,7 @@ func (c *barClient) TooManyArgs( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) diff --git a/examples/example-gateway/build/clients/custom-bar/custom-bar.go b/examples/example-gateway/build/clients/custom-bar/custom-bar.go index b1c366092..801540719 100644 --- a/examples/example-gateway/build/clients/custom-bar/custom-bar.go +++ b/examples/example-gateway/build/clients/custom-bar/custom-bar.go @@ -533,7 +533,7 @@ func (c *customBarClient) ArgNotStruct( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -1873,7 +1873,7 @@ func (c *customBarClient) Hello( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -1996,7 +1996,7 @@ func (c *customBarClient) ListAndEnum( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2104,7 +2104,7 @@ func (c *customBarClient) MissingArg( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2212,7 +2212,7 @@ func (c *customBarClient) NoRequest( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2321,7 +2321,7 @@ func (c *customBarClient) Normal( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2429,7 +2429,7 @@ func (c *customBarClient) NormalRecur( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2538,7 +2538,7 @@ func (c *customBarClient) TooManyArgs( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) @@ -2549,7 +2549,7 @@ func (c *customBarClient) TooManyArgs( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) diff --git a/examples/example-gateway/build/clients/withexceptions/withexceptions.go b/examples/example-gateway/build/clients/withexceptions/withexceptions.go index 1f9714a5d..b9912c2d2 100644 --- a/examples/example-gateway/build/clients/withexceptions/withexceptions.go +++ b/examples/example-gateway/build/clients/withexceptions/withexceptions.go @@ -296,7 +296,7 @@ func (c *withexceptionsClient) Func1( } v, err := res.ReadAndUnmarshalBodyMultipleOptions(allOptions) if err != nil { - zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), logFieldErrLocation) + zanzibar.AppendLogFieldsToContext(ctx, zap.Error(err), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) return ctx, defaultRes, respHeaders, err } zanzibar.AppendLogFieldsToContext(ctx, zap.Error(v.(error)), zanzibar.LogFieldErrTypeClientException, logFieldErrLocation) diff --git a/runtime/client_http_request_test.go b/runtime/client_http_request_test.go index 4b2b70028..d9bc8de91 100644 --- a/runtime/client_http_request_test.go +++ b/runtime/client_http_request_test.go @@ -24,7 +24,6 @@ import ( "context" "encoding/json" "fmt" - "go.uber.org/zap" "io" "net/http" "strings" @@ -41,6 +40,7 @@ import ( benchGateway "github.com/uber/zanzibar/test/lib/bench_gateway" testGateway "github.com/uber/zanzibar/test/lib/test_gateway" "github.com/uber/zanzibar/test/lib/util" + "go.uber.org/zap" ) var defaultTestOptions = &testGateway.Options{ diff --git a/runtime/client_http_response_test.go b/runtime/client_http_response_test.go index efaa73045..125c71a0a 100644 --- a/runtime/client_http_response_test.go +++ b/runtime/client_http_response_test.go @@ -22,7 +22,6 @@ package zanzibar_test import ( "context" - "go.uber.org/zap" "net/http" "testing" "time" @@ -34,6 +33,7 @@ import ( benchGateway "github.com/uber/zanzibar/test/lib/bench_gateway" testGateway "github.com/uber/zanzibar/test/lib/test_gateway" "github.com/uber/zanzibar/test/lib/util" + "go.uber.org/zap" ) func TestReadAndUnmarshalNonStructBody(t *testing.T) { From b785dd7815c19e912614e133adf8db1f3c67e0f3 Mon Sep 17 00:00:00 2001 From: Amol Mejari Date: Mon, 17 Jul 2023 10:12:57 +0530 Subject: [PATCH 86/86] fix test --- runtime/client_http_request_test.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/runtime/client_http_request_test.go b/runtime/client_http_request_test.go index d9bc8de91..2065e7552 100644 --- a/runtime/client_http_request_test.go +++ b/runtime/client_http_request_test.go @@ -336,9 +336,26 @@ func TestBarClientWithoutHeaders(t *testing.T) { retryOptionsCopy := retryOptions retryOptionsCopy.MaxAttempts = 1 + ctx := zanzibar.WithSafeLogFields(context.Background()) _, _, _, err = bar.EchoI8( - context.Background(), nil, &clientsBarBar.Echo_EchoI8_Args{Arg: 42}, + ctx, nil, &clientsBarBar.Echo_EchoI8_Args{Arg: 42}, ) + + assert.NotNil(t, err) + assert.Equal(t, "missing mandatory headers: x-uuid", err.Error()) + + logFieldsMap := getLogFieldsMapFromContext(ctx) + expectedFields := []zap.Field{ + zap.Error(err), + zap.String("error_location", "client::bar"), + } + for _, field := range expectedFields { + _, ok := logFieldsMap[field.Key] + assert.True(t, ok, "expected field missing: %s", field.Key) + if ok { + assert.Equal(t, field, logFieldsMap[field.Key]) + } + } } func TestMakingClientCallWithRespHeaders(t *testing.T) {