test: fix completions test failure on Go 1.26#2423
Conversation
…tions_test Under Go 1.26, `go vet` has tightened its format verb checks, flagging `%q` when used on the integer-based `ShellCompDirective` type: `(*testing.common).Errorf format %q has arg directive of wrong type github.com/spf13/cobra.ShellCompDirective` This fixes the issue by formatting the directive using `%s` alongside its unexported `string()` helper method, keeping the change isolated to the test file. Fixes spf13#2422
|
Thanks. If you can check the CI errors, then we'll be good to go. |
fb568b6 to
61768cc
Compare
d7135e3 to
f4a82e8
Compare
|
Hi Marc, Regarding the CI errors, I have investigated them and plan to apply the following fixes:
I will update the branch with these changes once you confirm this is the correct approach. Alternatively, if you think a different approach would be better, please let me know and I will apply those changes instead. |
Co-authored-by: Christophe Colombier <3875889+ccoVeille@users.noreply.github.com>
|
Hey @marckhouzam, thanks for taking the time to review this we really appreciate it From what I can see, the CI failures aren't related to my changes; they also occur on the If you're okay with it, I can open a separate PR to address the issue mentioned here: #2423 (comment). I have included my proposed approach to the solution, and I'd really appreciate your feedback if you think there's a better way to handle it. Otherwise, if you prefer, you can assign it to someone else. |
|
@SudhanshuMatrix I had written an answer asking for exactly what you have done but never pressed "send" 😞 . thanks for taking the initiative. I'll have a look. |
|
So, yes, please open a separate PR configuring out the warning about constants please. |
|
@marckhouzam Done. I have opened a separate Pull Request here: #2429 with only the CI and linter configuration updates (the macOS linking workaround and the |
|
@marckhouzam Hi! Just a follow-up on this PR. The separate CI fix has now been merged, so this PR is now passing all checks. Whenever you have some time, I'd appreciate another review. Thanks! |
Under Go 1.26,
go vethas tightened its format verb checks, flagging%qwhen used on the integer-basedShellCompDirectivetype:(*testing.common).Errorf format %q has arg directive of wrong type github.com/spf13/cobra.ShellCompDirectiveThis fixes the issue by formatting the directive as a string using its unexported
string()helper method, keeping the change isolated to the test file.Fixes #2422