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

Configure linter to check for unclosed http body #2392

Merged
merged 1 commit into from
Jul 2, 2019
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
1 change: 1 addition & 0 deletions hack/linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ fi

golangci-lint run \
--no-config \
-E bodyclose \
-E goconst \
-E goimports \
-E gocritic \
Expand Down
4 changes: 4 additions & 0 deletions integration/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ func TestEventLogHTTP(t *testing.T) {
if err != nil {
t.Fatalf("error connecting to gRPC REST API: %s", err.Error())
}
defer httpResponse.Body.Close()

numEntries := 0
var logEntries []proto.LogEntry
for {
Expand Down Expand Up @@ -303,6 +305,8 @@ func retrieveHTTPState(t *testing.T, httpAddr string) proto.State {
if err != nil {
t.Fatalf("error connecting to gRPC REST API: %s", err.Error())
}
defer httpResponse.Body.Close()

b, err := ioutil.ReadAll(httpResponse.Body)
if err != nil {
t.Errorf("error reading body from http response: %s", err.Error())
Expand Down