all: execute gofmt
Change-Id: I130e0ea017fac790ef49a2dda1b7003a7132f061
Reviewed-on: https://go-review.googlesource.com/c/build/+/619635
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/cmd/coordinator/trybot_dev.go b/cmd/coordinator/trybot_dev.go
index 86e1dc6..34ce139 100644
--- a/cmd/coordinator/trybot_dev.go
+++ b/cmd/coordinator/trybot_dev.go
@@ -28,14 +28,14 @@
failed: []string{"failed-build"},
remain: 1,
builds: []*buildStatus{
- &buildStatus{
+ {
BuilderRev: buildgo.BuilderRev{
Name: "linux-amd64-race",
Rev: "555cfa3ee5e9f3df4b10c96af487424bfde19125",
},
startTime: time.Now(),
},
- &buildStatus{
+ {
BuilderRev: buildgo.BuilderRev{
Name: "darwin-amd64-race",
Rev: "555cfa3ee5e9f3df4b10c96af487424bfde19125",
diff --git a/cmd/makemac/main.go b/cmd/makemac/main.go
index df11eb6..4da9a85 100644
--- a/cmd/makemac/main.go
+++ b/cmd/makemac/main.go
@@ -6,16 +6,16 @@
//
// It performs several different operations:
//
-// * Detects MacService leases that MacService thinks are running, but never
-// connected to LUCI (failed to boot?) and destroys them.
-// * Detects MacService leases that MacService thinks are running, but LUCI
-// thinks are dead (froze/crashed?) and destoys them.
-// * Renews MacService leases that both MacService and LUCI agree are healthy
-// to ensure they don't expire.
-// * Destroys MacService leases with images that are not requested by the
-// configuration in config.go.
-// * Launches new MacService leases to ensure that there are the at least as
-// many leases of each type as specified in the configuration in config.go.
+// - Detects MacService leases that MacService thinks are running, but never
+// connected to LUCI (failed to boot?) and destroys them.
+// - Detects MacService leases that MacService thinks are running, but LUCI
+// thinks are dead (froze/crashed?) and destoys them.
+// - Renews MacService leases that both MacService and LUCI agree are healthy
+// to ensure they don't expire.
+// - Destroys MacService leases with images that are not requested by the
+// configuration in config.go.
+// - Launches new MacService leases to ensure that there are the at least as
+// many leases of each type as specified in the configuration in config.go.
package main
import (
@@ -42,12 +42,12 @@
)
const (
- createExpirationDuration = 24*time.Hour
+ createExpirationDuration = 24 * time.Hour
createExpirationDurationString = "86400s"
// Shorter renew expiration is a workaround to detect newly-created
// leases. See comment in handleMissingBots.
- renewExpirationDuration = 23*time.Hour
+ renewExpirationDuration = 23 * time.Hour
renewExpirationDurationString = "82800s" // 23h
)
@@ -92,7 +92,7 @@
// Initialize each swarming client.
for sc, ic := range prodImageConfig {
c, err := swarming.NewClient(ctx, swarming.ClientOptions{
- ServiceURL: "https://"+sc.Host,
+ ServiceURL: "https://" + sc.Host,
AuthenticatedClient: ac,
})
if err != nil {
@@ -482,10 +482,10 @@
return macservice.LeaseRequest{
VMResourceNamespace: macservice.Namespace{
CustomerName: macServiceCustomer,
- ProjectName: managedProjectPrefix+"/"+sc.Host,
+ ProjectName: managedProjectPrefix + "/" + sc.Host,
},
InstanceSpecification: macservice.InstanceSpecification{
- Profile: macservice.V1_MEDIUM_VM,
+ Profile: macservice.V1_MEDIUM_VM,
AccessLevel: macservice.GOLANG_OSS,
DiskSelection: macservice.DiskSelection{
ImageHashes: macservice.ImageHashes{
diff --git a/cmd/racebuild/racebuild.go b/cmd/racebuild/racebuild.go
index 6559d99..8004e24 100644
--- a/cmd/racebuild/racebuild.go
+++ b/cmd/racebuild/racebuild.go
@@ -44,7 +44,7 @@
// TODO: use buildlet package instead of calling out to gomote.
var platforms = []*Platform{
- &Platform{
+ {
OS: "openbsd",
Arch: "amd64",
SubArch: "v1",
@@ -72,7 +72,7 @@
(cd go/src && ./race.bash)
`,
},
- &Platform{
+ {
OS: "freebsd",
Arch: "amd64",
SubArch: "v1",
@@ -99,7 +99,7 @@
(cd go/src && ./race.bash)
`,
},
- &Platform{
+ {
OS: "darwin",
Arch: "amd64",
SubArch: "v1",
@@ -126,7 +126,7 @@
(cd go/src && ./race.bash)
`,
},
- &Platform{
+ {
OS: "darwin",
Arch: "amd64",
SubArch: "v3",
@@ -150,7 +150,7 @@
(cd go/src && GOAMD64=v3 ./race.bash)
`,
},
- &Platform{
+ {
OS: "darwin",
Arch: "arm64",
Type: "darwin-arm64-12",
@@ -176,7 +176,7 @@
(cd go/src && ./race.bash)
`,
},
- &Platform{
+ {
OS: "linux",
Arch: "amd64",
SubArch: "v1",
@@ -205,7 +205,7 @@
(cd go/src && ./race.bash)
`,
},
- &Platform{
+ {
OS: "linux",
Arch: "amd64",
SubArch: "v3",
@@ -230,7 +230,7 @@
(cd go/src && GOAMD64=v3 ./race.bash)
`,
},
- &Platform{
+ {
OS: "linux",
Arch: "ppc64le",
Type: "linux-ppc64le-buildlet",
@@ -260,7 +260,7 @@
# (cd go/src && ./race.bash)
`,
},
- &Platform{
+ {
OS: "linux",
Arch: "arm64",
Type: "linux-arm64-race",
@@ -288,7 +288,7 @@
(cd go/src && ./race.bash)
`,
},
- &Platform{
+ {
OS: "netbsd",
Arch: "amd64",
SubArch: "v1",
@@ -316,7 +316,7 @@
# (cd go/src && ./race.bash)
`,
},
- &Platform{
+ {
OS: "windows",
Arch: "amd64",
SubArch: "v1",
@@ -365,7 +365,7 @@
if %errorlevel% neq 0 exit /b %errorlevel%
`,
},
- &Platform{
+ {
OS: "linux",
Arch: "s390x",
Type: "linux-s390x-ibm",
diff --git a/internal/cloud/aws.go b/internal/cloud/aws.go
index 40e3720..0fb8dd7 100644
--- a/internal/cloud/aws.go
+++ b/internal/cloud/aws.go
@@ -170,7 +170,7 @@
}
err := ac.ec2Client.DescribeInstancesPagesWithContext(ctx, &ec2.DescribeInstancesInput{
Filters: []*ec2.Filter{
- &ec2.Filter{
+ {
Name: aws.String("instance-state-name"),
Values: []*string{aws.String(ec2.InstanceStateNameRunning), aws.String(ec2.InstanceStateNamePending)},
},
@@ -325,14 +325,14 @@
KeyName: aws.String(config.SSHKeyID),
InstanceInitiatedShutdownBehavior: aws.String(ec2.ShutdownBehaviorTerminate),
TagSpecifications: []*ec2.TagSpecification{
- &ec2.TagSpecification{
+ {
ResourceType: aws.String("instance"),
Tags: []*ec2.Tag{
- &ec2.Tag{
+ {
Key: aws.String(tagName),
Value: aws.String(config.Name),
},
- &ec2.Tag{
+ {
Key: aws.String(tagDescription),
Value: aws.String(config.Description),
},
diff --git a/internal/cloud/fake_aws.go b/internal/cloud/fake_aws.go
index 87e0678..fd18817 100644
--- a/internal/cloud/fake_aws.go
+++ b/internal/cloud/fake_aws.go
@@ -36,12 +36,12 @@
return &FakeAWSClient{
instances: make(map[string]*Instance),
instanceTypes: []*InstanceType{
- &InstanceType{"ab.large", 10},
- &InstanceType{"ab.xlarge", 20},
- &InstanceType{"ab.small", 30},
+ {"ab.large", 10},
+ {"ab.xlarge", 20},
+ {"ab.small", 30},
},
serviceQuotas: map[serviceQuotaKey]int64{
- serviceQuotaKey{QuotaCodeCPUOnDemand, QuotaServiceEC2}: 384,
+ {QuotaCodeCPUOnDemand, QuotaServiceEC2}: 384,
},
}
}
diff --git a/internal/criadb/db.go b/internal/criadb/db.go
index e81516d..fb73df3 100644
--- a/internal/criadb/db.go
+++ b/internal/criadb/db.go
@@ -21,8 +21,8 @@
"go.chromium.org/luci/auth/identity"
"go.chromium.org/luci/server/auth"
"go.chromium.org/luci/server/auth/authdb"
- "go.chromium.org/luci/server/auth/authtest"
"go.chromium.org/luci/server/auth/authdb/dump"
+ "go.chromium.org/luci/server/auth/authtest"
"go.chromium.org/luci/server/caching"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
diff --git a/internal/gomote/swarming.go b/internal/gomote/swarming.go
index 3cfcbd0..e329805 100644
--- a/internal/gomote/swarming.go
+++ b/internal/gomote/swarming.go
@@ -483,7 +483,7 @@
return nil, err
}
var builders []string
- for builder, _ := range bs {
+ for builder := range bs {
builders = append(builders, builder)
}
sort.Strings(builders)
@@ -996,7 +996,7 @@
Priority: 20, // 30 is the priority for builds
ServiceAccount: "coordinator-builder@golang-ci-luci.iam.gserviceaccount.com",
TaskSlices: []*swarmpb.TaskSlice{
- &swarmpb.TaskSlice{
+ {
Properties: &swarmpb.TaskProperties{
CipdInput: &swarmpb.CipdInput{
Packages: packages,
@@ -1009,7 +1009,7 @@
Command: []string{pythonBin, "-c", buildletStartup(goos, goarch)},
Dimensions: createStringPairs(dimensions),
Env: []*swarmpb.StringPair{
- &swarmpb.StringPair{
+ {
Key: "GOMOTEID",
Value: name,
},
@@ -1099,7 +1099,7 @@
Priority: 20, // 30 is the priority for builds
ServiceAccount: "coordinator-builder@golang-ci-luci.iam.gserviceaccount.com",
TaskSlices: []*swarmpb.TaskSlice{
- &swarmpb.TaskSlice{
+ {
Properties: &swarmpb.TaskProperties{
CipdInput: &swarmpb.CipdInput{
Packages: packages,
@@ -1110,11 +1110,11 @@
Command: []string{pythonBin, "-c", golangbuildStartup(goos, goarch, golangbuildBin)},
Dimensions: createStringPairs(dimensions),
Env: []*swarmpb.StringPair{
- &swarmpb.StringPair{
+ {
Key: "GOMOTEID",
Value: name,
},
- &swarmpb.StringPair{
+ {
Key: "GOMOTE_SETUP",
Value: properties.BuilderId,
},