From eafe0c18d7a02fcae76fda2199b5946e2a1ddf24 Mon Sep 17 00:00:00 2001 From: mishudark Date: Sat, 26 May 2018 11:45:15 +0200 Subject: [PATCH 1/3] refactor(lint/unconvert): remove base64 call returns a string --- tracing/opentracing/grpc.go | 2 +- transport/grpc/request_response_funcs.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tracing/opentracing/grpc.go b/tracing/opentracing/grpc.go index 0122d65e4..2257bec8b 100644 --- a/tracing/opentracing/grpc.go +++ b/tracing/opentracing/grpc.go @@ -53,7 +53,7 @@ type metadataReaderWriter struct { func (w metadataReaderWriter) Set(key, val string) { key = strings.ToLower(key) if strings.HasSuffix(key, "-bin") { - val = string(base64.StdEncoding.EncodeToString([]byte(val))) + val = base64.StdEncoding.EncodeToString([]byte(val)) } (*w.MD)[key] = append((*w.MD)[key], val) } diff --git a/transport/grpc/request_response_funcs.go b/transport/grpc/request_response_funcs.go index a797d3df3..eb8e3b178 100644 --- a/transport/grpc/request_response_funcs.go +++ b/transport/grpc/request_response_funcs.go @@ -69,8 +69,7 @@ func SetResponseTrailer(key, val string) ServerResponseFunc { func EncodeKeyValue(key, val string) (string, string) { key = strings.ToLower(key) if strings.HasSuffix(key, binHdrSuffix) { - v := base64.StdEncoding.EncodeToString([]byte(val)) - val = string(v) + val = base64.StdEncoding.EncodeToString([]byte(val)) } return key, val } From 4ef528e6991d7cafd6f76961d10eb79a884c59d7 Mon Sep 17 00:00:00 2001 From: mishudark Date: Fri, 8 Jun 2018 16:00:40 +0200 Subject: [PATCH 2/3] chore(nats): fix comment on exported function --- transport/nats/publisher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/nats/publisher.go b/transport/nats/publisher.go index 7ba40fc52..7baab4d2f 100644 --- a/transport/nats/publisher.go +++ b/transport/nats/publisher.go @@ -19,7 +19,7 @@ type Publisher struct { timeout time.Duration } -// NewClient constructs a usable Publisher for a single remote method. +// NewPublisher constructs a usable Publisher for a single remote method. func NewPublisher( publisher *nats.Conn, subject string, From ec7ee1e36f81044f915ae5f9edc7a1211f88e224 Mon Sep 17 00:00:00 2001 From: Mishel Vera Date: Sun, 15 Jul 2018 22:50:33 +0200 Subject: [PATCH 3/3] fix(addsvc): dsl.Request requires an StringMatcher as path --- examples/addsvc/cmd/addsvc/pact_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/addsvc/cmd/addsvc/pact_test.go b/examples/addsvc/cmd/addsvc/pact_test.go index 2c709b58b..c2ca322ce 100644 --- a/examples/addsvc/cmd/addsvc/pact_test.go +++ b/examples/addsvc/cmd/addsvc/pact_test.go @@ -27,7 +27,7 @@ func TestPactStringsvcUppercase(t *testing.T) { WithRequest(dsl.Request{ Headers: map[string]string{"Content-Type": "application/json; charset=utf-8"}, Method: "POST", - Path: "/uppercase", + Path: dsl.String("/uppercase"), Body: `{"s":"foo"}`, }). WillRespondWith(dsl.Response{