Skip to content

Commit a3f5173

Browse files
authored
Merge pull request #172 from atlassian/jgonzalez/add_golint_ci
Add golint to CI to catch more linting errors
2 parents 4f7b0cc + a811d66 commit a3f5173

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ go:
1515
before_install:
1616
# install goreturns for linting
1717
- go get -u github.com/sqs/goreturns
18+
- go get -u golang.org/x/lint/golint
1819

1920
script:
2021
- make lint

lint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# Use Goreturns as a linter to pick up spacing formatting. Return exit code 1 if there are any errors
44
# Runs gofmt + goimports
5-
5+
# go returns
66
OUTPUT="$(goreturns -d -e cmd/ pkg/)"
77
test -z "$OUTPUT" || ((>&2 echo -e "$OUTPUT" "\ntry running 'make fmt'") && exit 1)
8+
9+
# golint
10+
golint -set_exit_status ./...

pkg/cloudprovider/aws/aws.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func (n *NodeGroup) setASGDesiredSizeOneShot(addCount int64) error {
349349
DefaultTargetCapacityType: awsapi.String("on-demand"),
350350
},
351351
LaunchTemplateConfigs: []*ec2.FleetLaunchTemplateConfigRequest{
352-
&ec2.FleetLaunchTemplateConfigRequest{
352+
{
353353
LaunchTemplateSpecification: &ec2.FleetLaunchTemplateSpecificationRequest{
354354
LaunchTemplateId: awsapi.String(n.config.AWSConfig.LaunchTemplateID),
355355
Version: awsapi.String(n.config.AWSConfig.LaunchTemplateVersion),
@@ -378,7 +378,7 @@ func (n *NodeGroup) setASGDesiredSizeOneShot(addCount int64) error {
378378
defer ticker.Stop()
379379
defer deadline.Stop()
380380

381-
// Escalator will block waiting for all nodes to become avaiable in this
381+
// Escalator will block waiting for all nodes to become available in this
382382
// node group for the maximum time specified in FleetInstanceReadyTimeout.
383383
// This should typically be quite fast as it's just the time for the
384384
// instance to boot and transition to ready state. The instance must be in
@@ -397,7 +397,7 @@ InstanceReadyLoop:
397397

398398
// The AttachInstances API only supports adding 20 instances at a time
399399
batchSize := 20
400-
batch := make([]*string, batchSize)
400+
var batch []*string
401401
for batchSize < len(instances) {
402402
instances, batch = instances[batchSize:], instances[0:batchSize:batchSize]
403403

pkg/test/aws.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/aws/aws-sdk-go/service/ec2/ec2iface"
99
)
1010

11-
// MockAutoscalingService is a mock implentation of a cloud provider interface
11+
// MockAutoscalingService is a mock implementation of a cloud provider interface
1212
type MockAutoscalingService struct {
1313
autoscalingiface.AutoScalingAPI
1414
*client.Client

0 commit comments

Comments
 (0)