Skip to content

Commit

Permalink
test(persistence): fix return value of w.Write is not checked
Browse files Browse the repository at this point in the history
  • Loading branch information
tgragnato committed Nov 17, 2024
1 parent 0a4579d commit 3073d57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion persistence/bitmagnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ func Test_bitmagnet_AddNewTorrent(t *testing.T) {

server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
if _, err := w.Write([]byte("OK")); err != nil {
t.Fatalf("failed to write response: %v", err)
}
}))
defer server.Close()

Expand Down

0 comments on commit 3073d57

Please sign in to comment.