Skip to content

Commit 5243639

Browse files
dmitshurgopherbot
authored andcommitted
all: fix printf(var) mistakes detected by latest printf checker
All of these fmt.Sprintf calls aren't needed. For golang/go#69267. Change-Id: Ie8e2719e1e94bac3810d4975a349614316e6e0d2 Reviewed-on: https://go-review.googlesource.com/c/build/+/610816 Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Funda Secgin <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent 79051a0 commit 5243639

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

dashboard/builders_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ func TestHostConfigIsVM(t *testing.T) {
10841084
},
10851085
}
10861086
for _, tc := range testCases {
1087-
t.Run(fmt.Sprintf(tc.desc), func(t *testing.T) {
1087+
t.Run(tc.desc, func(t *testing.T) {
10881088
if got := tc.config.IsVM(); got != tc.want {
10891089
t.Errorf("HostConfig.IsVM() = %t; want %t", got, tc.want)
10901090
}

internal/buildgo/buildgo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func VersionTgz(rev string) io.Reader {
224224
}
225225
}
226226

227-
contents := fmt.Sprintf("devel " + rev)
227+
contents := "devel " + rev
228228
check(tw.WriteHeader(&tar.Header{
229229
Name: "VERSION",
230230
Mode: 0644,

internal/cloud/aws_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -325,17 +325,17 @@ func fakeClientWithInstances(t *testing.T, count int, opts ...option) (*AWSClien
325325

326326
func randomVMConfig() *EC2VMConfiguration {
327327
return &EC2VMConfiguration{
328-
Description: fmt.Sprintf("description-" + randHex(4)),
329-
ImageID: fmt.Sprintf("image-" + randHex(4)),
330-
Name: fmt.Sprintf("name-" + randHex(4)),
331-
SSHKeyID: fmt.Sprintf("ssh-key-id-" + randHex(4)),
332-
SecurityGroups: []string{fmt.Sprintf("sg-" + randHex(4))},
328+
Description: "description-" + randHex(4),
329+
ImageID: "image-" + randHex(4),
330+
Name: "name-" + randHex(4),
331+
SSHKeyID: "ssh-key-id-" + randHex(4),
332+
SecurityGroups: []string{"sg-" + randHex(4)},
333333
Tags: map[string]string{
334-
fmt.Sprintf("tag-key-" + randHex(4)): fmt.Sprintf("tag-value-" + randHex(4)),
334+
"tag-key-" + randHex(4): "tag-value-" + randHex(4),
335335
},
336-
Type: fmt.Sprintf("type-" + randHex(4)),
337-
UserData: fmt.Sprintf("user-data-" + randHex(4)),
338-
Zone: fmt.Sprintf("zone-" + randHex(4)),
336+
Type: "type-" + randHex(4),
337+
UserData: "user-data-" + randHex(4),
338+
Zone: "zone-" + randHex(4),
339339
}
340340
}
341341

internal/relui/workflows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ func (tasks *BuildReleaseTasks) uploadModules(ctx *wf.TaskContext, version strin
15521552
want := map[string]bool{} // URLs we're waiting on becoming available.
15531553
for _, mod := range modules {
15541554
base := task.ToolchainModuleVersion(mod.Target, version)
1555-
if err := tasks.uploadFile(ctx, servingFS, mod.ZipScratch, fmt.Sprintf(base+".zip")); err != nil {
1555+
if err := tasks.uploadFile(ctx, servingFS, mod.ZipScratch, base+".zip"); err != nil {
15561556
return err
15571557
}
15581558
if err := gcsfs.WriteFile(servingFS, base+".info", []byte(mod.Info)); err != nil {

0 commit comments

Comments
 (0)