Skip to content

Commit

Permalink
all: fix printf(var) mistakes detected by latest printf checker
Browse files Browse the repository at this point in the history
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 <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Funda Secgin <fundasecgin38@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
  • Loading branch information
dmitshur authored and gopherbot committed Sep 4, 2024
1 parent 79051a0 commit 5243639
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dashboard/builders_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,7 @@ func TestHostConfigIsVM(t *testing.T) {
},
}
for _, tc := range testCases {
t.Run(fmt.Sprintf(tc.desc), func(t *testing.T) {
t.Run(tc.desc, func(t *testing.T) {
if got := tc.config.IsVM(); got != tc.want {
t.Errorf("HostConfig.IsVM() = %t; want %t", got, tc.want)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/buildgo/buildgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func VersionTgz(rev string) io.Reader {
}
}

contents := fmt.Sprintf("devel " + rev)
contents := "devel " + rev
check(tw.WriteHeader(&tar.Header{
Name: "VERSION",
Mode: 0644,
Expand Down
18 changes: 9 additions & 9 deletions internal/cloud/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,17 @@ func fakeClientWithInstances(t *testing.T, count int, opts ...option) (*AWSClien

func randomVMConfig() *EC2VMConfiguration {
return &EC2VMConfiguration{
Description: fmt.Sprintf("description-" + randHex(4)),
ImageID: fmt.Sprintf("image-" + randHex(4)),
Name: fmt.Sprintf("name-" + randHex(4)),
SSHKeyID: fmt.Sprintf("ssh-key-id-" + randHex(4)),
SecurityGroups: []string{fmt.Sprintf("sg-" + randHex(4))},
Description: "description-" + randHex(4),
ImageID: "image-" + randHex(4),
Name: "name-" + randHex(4),
SSHKeyID: "ssh-key-id-" + randHex(4),
SecurityGroups: []string{"sg-" + randHex(4)},
Tags: map[string]string{
fmt.Sprintf("tag-key-" + randHex(4)): fmt.Sprintf("tag-value-" + randHex(4)),
"tag-key-" + randHex(4): "tag-value-" + randHex(4),
},
Type: fmt.Sprintf("type-" + randHex(4)),
UserData: fmt.Sprintf("user-data-" + randHex(4)),
Zone: fmt.Sprintf("zone-" + randHex(4)),
Type: "type-" + randHex(4),
UserData: "user-data-" + randHex(4),
Zone: "zone-" + randHex(4),
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/relui/workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ func (tasks *BuildReleaseTasks) uploadModules(ctx *wf.TaskContext, version strin
want := map[string]bool{} // URLs we're waiting on becoming available.
for _, mod := range modules {
base := task.ToolchainModuleVersion(mod.Target, version)
if err := tasks.uploadFile(ctx, servingFS, mod.ZipScratch, fmt.Sprintf(base+".zip")); err != nil {
if err := tasks.uploadFile(ctx, servingFS, mod.ZipScratch, base+".zip"); err != nil {
return err
}
if err := gcsfs.WriteFile(servingFS, base+".info", []byte(mod.Info)); err != nil {
Expand Down

0 comments on commit 5243639

Please sign in to comment.