Skip to content

Conversation

torcolvin
Copy link
Collaborator

This is a more strict version of govet that is coming in go 1.24 and is already present in golangci-lint 1.24. All of the things flagged were false positives.

  • created NewHTTPError to cover when there are no arguments. I could have changed this code to NewHTTPErrorf(status, "%s", msg) but this seemed weird to me and like you wouldn't be sure why you had to use this code and would look this up.
  • Created FileLogger.log function but this could easily use logf("%s", msg) in the places we are using it like statsLogger and conditionalPrintf since they are called very irregularly.

I don't feel strongly about these implementation choices.

@torcolvin torcolvin requested review from bbrks and gregns1 October 1, 2024 14:28
gregns1
gregns1 previously approved these changes Oct 3, 2024
Copy link
Contributor

@gregns1 gregns1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me and think I agree with implementation choices instead of the use of ("%s", msg). Should we add more to the comments of the new log and NewHTTPError functions to add context of how they should be used when there are no arguments to be passed to format string? Happy to merge as is if you think not necessary so will approve as is.

@torcolvin torcolvin self-assigned this Oct 4, 2024
@torcolvin torcolvin merged commit 4f1f804 into main Oct 17, 2024
38 checks passed
@torcolvin torcolvin deleted the CBG-4282 branch October 17, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants