From edd21d1e7ac70fef924bdf62de88286d5493f48a Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Tue, 28 Jul 2015 11:58:06 -0400 Subject: [PATCH] Cleanup #11029 to use go autocast-after-type-switch (thanks to brendandburns for the suggestion) --- pkg/cloudprovider/aws/aws.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/cloudprovider/aws/aws.go b/pkg/cloudprovider/aws/aws.go index 2067442f923..b738a3530a3 100644 --- a/pkg/cloudprovider/aws/aws.go +++ b/pkg/cloudprovider/aws/aws.go @@ -1694,10 +1694,9 @@ func (s *AWSCloud) ensureSecurityGroup(name string, description string, vpcID st createResponse, err := s.ec2.CreateSecurityGroup(createRequest) if err != nil { ignore := false - switch err.(type) { + switch err := err.(type) { case awserr.Error: - awsError := err.(awserr.Error) - if awsError.Code() == "InvalidGroup.Duplicate" && attempt < MaxReadThenCreateRetries { + if err.Code() == "InvalidGroup.Duplicate" && attempt < MaxReadThenCreateRetries { glog.V(2).Infof("Got InvalidGroup.Duplicate while creating security group (race?); will retry") ignore = true }