Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alexliesenfeld committed Oct 17, 2023
1 parent c462213 commit fca8185
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ without or minimal adjustments:
Name: "google",
Check: func(ctx context.Context) error {
deadline, _ := ctx.Deadline()
timeout := time.Now().Sub(deadline)
timeout := time.Since(deadline)
return healthcheck.HTTPGetCheck("https://www.google.com", timeout)()
},
}),
Expand Down
2 changes: 1 addition & 1 deletion examples/compatibiltiy/heptiolabs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func main() {
Name: "google",
Check: func(ctx context.Context) error {
deadline, _ := ctx.Deadline()
timeout := time.Now().Sub(deadline)
timeout := time.Since(deadline)
return healthcheck.HTTPGetCheck("https://www.google.com", timeout)()
},
}),
Expand Down
1 change: 1 addition & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func NewHandler(checker Checker, options ...HandlerOption) http.HandlerFunc {
// Write HTTP response
disableResponseCache(w)
statusCode := mapHTTPStatusCode(result.Status, cfg.statusCodeUp, cfg.statusCodeDown)
//nolint:errcheck
cfg.resultWriter.Write(&result, statusCode, w, r)
}
}
Expand Down
2 changes: 1 addition & 1 deletion interceptors/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func BasicLogger() health.Interceptor {
now := time.Now()
result := next(ctx, name, state)
log.Printf("executed health check function of component %s in %f seconds (result: %s)",
name, time.Now().Sub(now).Seconds(), result.Status)
name, time.Since(now).Seconds(), result.Status)
return result
}
}
Expand Down
2 changes: 1 addition & 1 deletion middleware/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func BasicLogger() health.Middleware {
now := time.Now()
result := next(r)
log.Printf("processed health check request in %f seconds (result: %s)",
time.Now().Sub(now).Seconds(), result.Status)
time.Since(now).Seconds(), result.Status)
return result
}
}
Expand Down

0 comments on commit fca8185

Please sign in to comment.