Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(lint/unconvert): remove base64 call returns a string #717

Merged
merged 3 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/addsvc/cmd/addsvc/pact_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion tracing/opentracing/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 1 addition & 2 deletions transport/grpc/request_response_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion transport/nats/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down