Skip to content

Commit

Permalink
healthz: golangci-lint fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub authored and askervin committed Dec 11, 2024
1 parent 8af4c2e commit 26aa513
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/healthz/healthz.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@ func serve(w http.ResponseWriter, req *http.Request) {
status, details := check()
if status == Healthy {
w.WriteHeader(200)
w.Write([]byte("ok"))
_, err := w.Write([]byte("ok"))
if err != nil {
log.Errorf("failed to write response: %v", err)
}
} else {
errors := ""
for _, err := range details {
errors += fmt.Sprintf("%v\n", err)
}
w.WriteHeader(500)
w.Write([]byte(errors))
_, err := w.Write([]byte(errors))
if err != nil {
log.Errorf("failed to write response: %v", err)
}
}
}

Expand Down

0 comments on commit 26aa513

Please sign in to comment.