Skip to content

Commit 5550f4e

Browse files
withshubhsagikazarmark
authored andcommitted
Fix nil context being passed to function
1 parent abd72ba commit 5550f4e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

transport/http/proto/proto_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package proto
22

33
import (
4+
"context"
45
"io/ioutil"
56
"net/http"
67
"net/http/httptest"
@@ -14,7 +15,7 @@ func TestEncodeProtoRequest(t *testing.T) {
1415

1516
r := httptest.NewRequest(http.MethodGet, "/cat", nil)
1617

17-
err := EncodeProtoRequest(nil, r, cat)
18+
err := EncodeProtoRequest(context.TODO(), r, cat)
1819
if err != nil {
1920
t.Errorf("expected no encoding errors but got: %s", err)
2021
return
@@ -51,7 +52,7 @@ func TestEncodeProtoResponse(t *testing.T) {
5152

5253
wr := httptest.NewRecorder()
5354

54-
err := EncodeProtoResponse(nil, wr, cat)
55+
err := EncodeProtoResponse(context.TODO(), wr, cat)
5556
if err != nil {
5657
t.Errorf("expected no encoding errors but got: %s", err)
5758
return

0 commit comments

Comments
 (0)