Repository navigation
Fix lint errors - #109
Merged
Merged
Fix lint errors#109
Conversation
errtrace is flagging a few fmt.Fprint{f,ln} calls. Fix them by:
* Adding error checks to writes that are required for functionality
* Use separate `log{f,ln}` functions for non-required writes intended
for logging, and ignore errors in the log functions.
* Ignore write errors to `fmt.State`
This was referenced Nov 10, 2024
abhinav
approved these changes
Nov 10, 2024
Comment on lines
+1213
to
+1214
| //nolint:errcheck // logging writes are best-effort | ||
| fmt.Fprintln(w, s) |
Contributor
There was a problem hiding this comment.
Ignoring with _ is nicer than nolint, IMO
Suggested change
| //nolint:errcheck // logging writes are best-effort | |
| fmt.Fprintln(w, s) | |
| _, _ = fmt.Fprintln(w, s) // logging writes are best-effort |
Comment on lines
+1218
to
+1219
| //nolint:errcheck // logging writes are best-effort | ||
| fmt.Fprintf(w, format, a...) |
Contributor
There was a problem hiding this comment.
Suggested change
| //nolint:errcheck // logging writes are best-effort | |
| fmt.Fprintf(w, format, a...) | |
| _, _ = fmt.Fprintf(w, format, a...) // logging writes are best-effort |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
errtrace is flagging a few fmt.Fprint{f,ln} calls. Fix them by:
log{f,ln}functions for non-required writes intendedfor logging, and ignore errors in the log functions.
fmt.State