Skip to content

Commit

Permalink
fix(ci): lint
Browse files Browse the repository at this point in the history
  • Loading branch information
darkweak committed Jul 19, 2023
1 parent a63875c commit 2b89309
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions httpcache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func (t *testErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {

w.Header().Set("Cache-Control", "must-revalidate")
w.WriteHeader(http.StatusOK)
w.Write([]byte("Hello must-revalidate!"))
_, _ = w.Write([]byte("Hello must-revalidate!"))
}

func TestMustRevalidate(t *testing.T) {
Expand All @@ -366,7 +366,9 @@ func TestMustRevalidate(t *testing.T) {
}`, "caddyfile")

errorHandler := testErrorHandler{}
go http.ListenAndServe(":9081", &errorHandler)
go func(teh *testErrorHandler) {
http.ListenAndServe(":9081", teh)

Check failure on line 370 in httpcache_test.go

View workflow job for this annotation

GitHub Actions / Lint

Error return value of `http.ListenAndServe` is not checked (errcheck)
}(&errorHandler)
time.Sleep(time.Second)
resp1, _ := tester.AssertGetResponse(`http://localhost:9080/cache-default`, http.StatusOK, "Hello must-revalidate!")
resp2, _ := tester.AssertGetResponse(`http://localhost:9080/cache-default`, http.StatusOK, "Hello must-revalidate!")
Expand Down

0 comments on commit 2b89309

Please sign in to comment.