Skip to content

fix printf-related go vet violations#46

Merged
iliana merged 1 commit intorelease-22.1-oxidefrom
iliana/printf
Feb 27, 2026
Merged

fix printf-related go vet violations#46
iliana merged 1 commit intorelease-22.1-oxidefrom
iliana/printf

Conversation

@iliana
Copy link
Collaborator

@iliana iliana commented Feb 27, 2026

In Go 1.24, the printf analyzer in go vet was improved to catch cases where the format string is a non-const string. This is a pretty strong code smell and I think qualifies as worth changing despite wanting to avoid code churn -- the code is fundamentally wrong.

There's a few additional cases found in newer versions of Go where the format string specifier and the type of the value being formatted don't match. These cases deserve some extra scrutiny during review, particularly since I am not fluent in Go.

This is split out from the Go 1.26 PR I'm working on, since it can be applied any time.

@iliana iliana requested a review from sudomateo February 27, 2026 02:04
Copy link

@sudomateo sudomateo left a comment

Choose a reason for hiding this comment

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

Left one suggestion based on what I thought the code should look like. Everything else looks good!

@iliana iliana merged commit 4088380 into release-22.1-oxide Feb 27, 2026
14 checks passed
@iliana iliana deleted the iliana/printf branch February 27, 2026 18:49
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