From 2a5259c46f35dacee07d048fdee01728106bae51 Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Fri, 5 Oct 2018 15:31:43 -0400 Subject: [PATCH] gofmt/govet cleanup (#167) --- cloud/aws/providerconfig/v1alpha1/types.go | 4 ++-- cloud/aws/services/ec2/bastion.go | 2 +- cloud/aws/services/ec2/instances_test.go | 8 ++++---- cloud/aws/services/ec2/natgateways_test.go | 4 ++-- cloud/aws/services/ec2/subnets_test.go | 2 +- cloud/aws/services/ec2/vpc_test.go | 2 +- cloud/aws/services/elb/loadbalancer.go | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cloud/aws/providerconfig/v1alpha1/types.go b/cloud/aws/providerconfig/v1alpha1/types.go index be36ec59c1..f6095b01c3 100644 --- a/cloud/aws/providerconfig/v1alpha1/types.go +++ b/cloud/aws/providerconfig/v1alpha1/types.go @@ -240,7 +240,7 @@ var ( type ClassicELB struct { // The name of the load balancer. It must be unique within the set of load balancers // defined in the region. It also serves as identifier. - Name string `json:"name` + Name string `json:"name"` // DNSName is the dns name of the load balancer. DNSName string `json:"dnsName"` @@ -276,7 +276,7 @@ type ClassicELBListener struct { type ClassicELBHealthCheck struct { Target string `json:"target"` Interval time.Duration `json:"interval"` - Timeout time.Duration `json:"interval"` + Timeout time.Duration `json:"timeout"` HealthyThreshold int64 `json:"healthyThreshold"` UnhealthyThreshold int64 `json:"unhealthyThreshold"` } diff --git a/cloud/aws/services/ec2/bastion.go b/cloud/aws/services/ec2/bastion.go index 54c007b621..0f1de394da 100644 --- a/cloud/aws/services/ec2/bastion.go +++ b/cloud/aws/services/ec2/bastion.go @@ -87,7 +87,7 @@ func (s *Service) describeBastionInstance(clusterName string, status *v1alpha1.A input := &ec2.DescribeInstancesInput{ Filters: []*ec2.Filter{ - &ec2.Filter{ + { Name: aws.String(fmt.Sprintf("tag:%s", TagNameAWSClusterAPIRole)), Values: []*string{aws.String(TagValueBastionRole)}, }, diff --git a/cloud/aws/services/ec2/instances_test.go b/cloud/aws/services/ec2/instances_test.go index f5926dc087..79a388074f 100644 --- a/cloud/aws/services/ec2/instances_test.go +++ b/cloud/aws/services/ec2/instances_test.go @@ -70,7 +70,7 @@ func TestInstanceIfExists(t *testing.T) { Reservations: []*ec2.Reservation{ { Instances: []*ec2.Instance{ - &ec2.Instance{ + { InstanceId: aws.String("id-1"), InstanceType: aws.String("m5.large"), SubnetId: aws.String("subnet-1"), @@ -217,10 +217,10 @@ func TestCreateInstance(t *testing.T) { }, }, SecurityGroups: map[v1alpha1.SecurityGroupRole]*v1alpha1.SecurityGroup{ - v1alpha1.SecurityGroupControlPlane: &v1alpha1.SecurityGroup{ + v1alpha1.SecurityGroupControlPlane: { ID: "1", }, - v1alpha1.SecurityGroupNode: &v1alpha1.SecurityGroup{ + v1alpha1.SecurityGroupNode: { ID: "2", }, }, @@ -238,7 +238,7 @@ func TestCreateInstance(t *testing.T) { }). Return(&ec2.Reservation{ Instances: []*ec2.Instance{ - &ec2.Instance{ + { State: &ec2.InstanceState{ Name: aws.String(ec2.InstanceStateNamePending), }, diff --git a/cloud/aws/services/ec2/natgateways_test.go b/cloud/aws/services/ec2/natgateways_test.go index 04acad211d..572e48c5fa 100644 --- a/cloud/aws/services/ec2/natgateways_test.go +++ b/cloud/aws/services/ec2/natgateways_test.go @@ -185,7 +185,7 @@ func TestReconcileNatGateways(t *testing.T) { }), gomock.Any()).Do(func(_, y interface{}) { funct := y.(func(page *ec2.DescribeNatGatewaysOutput, lastPage bool) bool) - funct(&ec2.DescribeNatGatewaysOutput{NatGateways: []*ec2.NatGateway{&ec2.NatGateway{ + funct(&ec2.DescribeNatGatewaysOutput{NatGateways: []*ec2.NatGateway{{ NatGatewayId: aws.String("gateway"), SubnetId: aws.String("subnet-1"), }}}, true) @@ -261,7 +261,7 @@ func TestReconcileNatGateways(t *testing.T) { }), gomock.Any()).Do(func(_, y interface{}) { funct := y.(func(page *ec2.DescribeNatGatewaysOutput, lastPage bool) bool) - funct(&ec2.DescribeNatGatewaysOutput{NatGateways: []*ec2.NatGateway{&ec2.NatGateway{ + funct(&ec2.DescribeNatGatewaysOutput{NatGateways: []*ec2.NatGateway{{ NatGatewayId: aws.String("gateway"), SubnetId: aws.String("subnet-1"), }}}, true) diff --git a/cloud/aws/services/ec2/subnets_test.go b/cloud/aws/services/ec2/subnets_test.go index adf38e47fb..8237f1d95e 100644 --- a/cloud/aws/services/ec2/subnets_test.go +++ b/cloud/aws/services/ec2/subnets_test.go @@ -76,7 +76,7 @@ func TestReconcileSubnets(t *testing.T) { })). Return(&ec2.DescribeSubnetsOutput{ Subnets: []*ec2.Subnet{ - &ec2.Subnet{ + { VpcId: aws.String(subnetsVPCID), SubnetId: aws.String("subnet-1"), AvailabilityZone: aws.String("us-east-1a"), diff --git a/cloud/aws/services/ec2/vpc_test.go b/cloud/aws/services/ec2/vpc_test.go index 6c8df4c6f0..d90e22fda9 100644 --- a/cloud/aws/services/ec2/vpc_test.go +++ b/cloud/aws/services/ec2/vpc_test.go @@ -47,7 +47,7 @@ func TestReconcileVPC(t *testing.T) { })). Return(&ec2.DescribeVpcsOutput{ Vpcs: []*ec2.Vpc{ - &ec2.Vpc{ + { VpcId: aws.String("vpc-exists"), CidrBlock: aws.String("10.0.0.0/8"), }, diff --git a/cloud/aws/services/elb/loadbalancer.go b/cloud/aws/services/elb/loadbalancer.go index a7ab4f5c58..5b11a1ec56 100644 --- a/cloud/aws/services/elb/loadbalancer.go +++ b/cloud/aws/services/elb/loadbalancer.go @@ -57,7 +57,7 @@ func (s *Service) getAPIServerClassicELBSpec(clusterName string, network *v1alph Name: fmt.Sprintf("%s-apiserver", clusterName), Scheme: v1alpha1.ClassicELBSchemeInternetFacing, Listeners: []*v1alpha1.ClassicELBListener{ - &v1alpha1.ClassicELBListener{ + { Protocol: v1alpha1.ClassicELBProtocolTCP, Port: 6443, InstanceProtocol: v1alpha1.ClassicELBProtocolTCP,