Repository navigation
parallels: Fix wrong format string in Debugf call - #23663
Conversation
log.Debugf on line 425 used %d (integer format) for the 'ver' argument, which is of type *github.com/hashicorp/go-version.Version. This is incorrect because %d expects an integer. On some Go versions (e.g. go1.26.0), go vet flags this as a build error, causing 'make gotest' to fail with: log.Debugf format %d has arg ver of wrong type *github.com/hashicorp/go-version.Version Fix by changing the format verb from %d to %s. The Version type implements the Stringer interface, so %s correctly prints the version string. Signed-off-by: Rishi Raj <[email protected]>
|
Hi @rishiraj38. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Can one of the admins verify this patch? |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nirs, rishiraj38 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Problem
log.Debugfinparallels_darwin.go:425uses%d(integer format verb) for theverargument, which is of type*github.com/hashicorp/go-version.Version. This is incorrect because%dexpects an integer.On some Go versions (e.g. go1.26.0),
go vetflags this as a build error, causingmake gotestto fail with:Solution
Change the format verb from
%dto%s. The*go-version.Versiontype implements theStringerinterface (String()method), so%sis the correct verb to print the version string.