Skip to content

Commit 3ff3891

Browse files
cuishuanggopherbot
authored andcommitted
all: use a more straightforward return value
Change-Id: I3b6b8125e305ac5731e1bf77ab5b49471a9bcda7 Reviewed-on: https://go-review.googlesource.com/c/build/+/653199 Reviewed-by: Carlos Amedee <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent d88d631 commit 3ff3891

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

internal/cloud/aws.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (ac *AWSClient) Instance(ctx context.Context, instID string) (*Instance, er
153153
return nil, errors.New("describe instances output does not contain a valid instance")
154154
}
155155
ec2Inst := dio.Reservations[0].Instances[0]
156-
return ec2ToInstance(ec2Inst), err
156+
return ec2ToInstance(ec2Inst), nil
157157
}
158158

159159
// RunningInstances retrieves all EC2 instances in a region which have not been terminated or stopped.
@@ -206,7 +206,7 @@ func (ac *AWSClient) DestroyInstances(ctx context.Context, instIDs ...string) er
206206
if err != nil {
207207
return fmt.Errorf("unable to destroy vm: %w", err)
208208
}
209-
return err
209+
return nil
210210
}
211211

212212
// WaitUntilInstanceRunning waits until a stopping condition is met. The stopping conditions are:
@@ -220,7 +220,7 @@ func (ac *AWSClient) WaitUntilInstanceRunning(ctx context.Context, instID string
220220
if err != nil {
221221
return fmt.Errorf("failed waiting for vm instance: %w", err)
222222
}
223-
return err
223+
return nil
224224
}
225225

226226
// InstanceType contains information about an EC2 vm instance type.

internal/gomote/gomote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ func (s *Server) signURLForDownload(object string) (url string, err error) {
512512
if err != nil {
513513
return "", fmt.Errorf("unable to generate signed url: %w", err)
514514
}
515-
return url, err
515+
return url, nil
516516
}
517517

518518
// WriteFileFromURL initiates an HTTP request to the passed in URL and streams the contents of the request to the gomote instance.

internal/gomote/swarming.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ func (ss *SwarmingServer) signURLForDownload(object string) (url string, err err
763763
if err != nil {
764764
return "", fmt.Errorf("unable to generate signed url: %w", err)
765765
}
766-
return url, err
766+
return url, nil
767767
}
768768

769769
// SwarmOpts provides additional options for swarming task creation.

internal/task/buildbucket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (c *RealBuildBucketClient) RunBuild(ctx context.Context, bucket, builder st
6565
if err != nil {
6666
return 0, err
6767
}
68-
return build.Id, err
68+
return build.Id, nil
6969
}
7070

7171
func (c *RealBuildBucketClient) Completed(ctx context.Context, id int64) (string, bool, error) {

internal/task/releasevscodego.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ func (r *ReleaseVSCodeGoTasks) determineReleaseVersion(ctx *wf.TaskContext, vers
471471
default:
472472
return releaseVersion{}, fmt.Errorf("unknown version selection strategy: %q", versionBumpStrategy)
473473
}
474-
return release, err
474+
return release, nil
475475
}
476476

477477
// nextPrereleaseVersion inspects the tags in vscode-go repo that match with the

maintner/github.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ func (p *githubRepoPoller) getMilestonePage(ctx context.Context, page int) ([]in
16381638
for i, m := range ms {
16391639
its[i] = m
16401640
}
1641-
return its, res, err
1641+
return its, res, nil
16421642
}
16431643

16441644
func (p *githubRepoPoller) getLabelPage(ctx context.Context, page int) ([]interface{}, *github.Response, error) {
@@ -1652,7 +1652,7 @@ func (p *githubRepoPoller) getLabelPage(ctx context.Context, page int) ([]interf
16521652
for i, lb := range ls {
16531653
its[i] = lb
16541654
}
1655-
return its, res, err
1655+
return its, res, nil
16561656
}
16571657

16581658
// foreachItem walks over all pages of items from getPage and calls fn for each item.

0 commit comments

Comments
 (0)