Skip to content

Add logging functions to govet printf analyzer #34824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Jun 23, 2025

In theory, this should make those logging functions recognized by govet printf analyzer and it should raise lint errors for cases like mismatched arguments like #34810. From go tool vet help printf:

The check applies to calls of the formatting functions such as
[fmt.Printf] and [fmt.Sprintf], as well as any detected wrappers of
those functions such as [log.Printf]. It reports a variety of
mistakes such as syntax errors in the format string and mismatches
(of number and type) between the verbs and their arguments.

Currently, this does not seem to work locally, therefor draft.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 23, 2025
@silverwind silverwind marked this pull request as draft June 23, 2025 14:06
Signed-off-by: silverwind <[email protected]>
@silverwind
Copy link
Member Author

silverwind commented Jun 23, 2025

As long as #34810 is not merged on main, CI should fail, but it does not. There must be something wrong with the config, docs here.

@silverwind
Copy link
Member Author

No idea how to continue, let's close it.

@silverwind silverwind closed this Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants