Skip to content

Commit

Permalink
Close response body
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany committed May 19, 2023
1 parent 1b31b11 commit 5f2ab9c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion httputil/middleware_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ func ExampleChain() {
srv := httptest.NewServer(h)
defer srv.Close()

if _, err := http.Get(srv.URL); err != nil {
resp, err := http.Get(srv.URL)
if err != nil {
panic(err)
}
defer resp.Body.Close()

// Output:
// annotate: one
Expand Down

0 comments on commit 5f2ab9c

Please sign in to comment.