Skip to content

Commit 35fe66d

Browse files
authored
Fix some printf format calls as go 1.24 govet fails if the format strings are not constant. (#847)
1 parent a680d3b commit 35fe66d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cmd/auth-provider-gcp/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ func main() {
3939
}
4040
credCmd, err := app.NewGetCredentialsCommand()
4141
if err != nil {
42-
klog.Errorf(err.Error())
42+
klog.Errorf("%s", err.Error())
4343
os.Exit(1)
4444
}
4545
rootCmd.AddCommand(credCmd)
4646
klog.InitFlags(nil)
4747
flag.Parse()
4848
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
4949
if err := rootCmd.Execute(); err != nil {
50-
klog.Errorf(err.Error())
50+
klog.Errorf("%s", err.Error())
5151
os.Exit(1)
5252
}
5353
}

pkg/clientauthplugin/gcp/gcp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func TestHelperProcess(t *testing.T) {
113113
fmt.Fprintf(os.Stdout, "call cmd=%q got args %v, want: %v\n", gotCmd, gotArgs, output.args)
114114
os.Exit(1)
115115
}
116-
fmt.Fprintf(os.Stdout, output.output)
116+
fmt.Fprintf(os.Stdout, "%s", output.output)
117117
os.Exit(0)
118118
}
119119

0 commit comments

Comments
 (0)