Skip to content

Commit 353140a

Browse files
committed
[Provider/Azure] remove extra Sprintf
1 parent 356c121 commit 353140a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

staging/src/k8s.io/legacy-cloud-providers/azure/azure_instances_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func TestInstanceID(t *testing.T) {
131131

132132
mux := http.NewServeMux()
133133
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
134-
fmt.Fprint(w, fmt.Sprintf(`{"compute":{"name":"%s","subscriptionId":"subscription","resourceGroupName":"rg"}}`, test.metadataName))
134+
fmt.Fprintf(w, "{\"compute\":{\"name\":\"%s\",\"subscriptionId\":\"subscription\",\"resourceGroupName\":\"rg\"}}", test.metadataName)
135135
}))
136136
go func() {
137137
http.Serve(listener, mux)
@@ -350,7 +350,7 @@ func TestNodeAddresses(t *testing.T) {
350350

351351
mux := http.NewServeMux()
352352
mux.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
353-
fmt.Fprint(w, fmt.Sprintf(metadataTemplate, test.nodeName, test.ipV4, test.ipV4Public, test.ipV6, test.ipV6Public))
353+
fmt.Fprint(w, metadataTemplate, test.nodeName, test.ipV4, test.ipV4Public, test.ipV6, test.ipV6Public)
354354
}))
355355
go func() {
356356
http.Serve(listener, mux)

0 commit comments

Comments
 (0)