builder/amazon/common: remove nil check on slice, len() on nil slices is zero
This commit is contained in:
parent
ada9821897
commit
e5e2bfa83f
|
@ -69,7 +69,6 @@ func TestAMIConfigPrepare_regions(t *testing.T) {
|
|||
if errs = c.prepareRegions(accessConf); len(errs) > 0 {
|
||||
t.Fatalf("shouldn't have err: %#v", errs)
|
||||
}
|
||||
errs = errs[:0]
|
||||
|
||||
c.AMIRegions = []string{"us-east-1", "us-west-1", "us-east-1"}
|
||||
if errs = c.prepareRegions(accessConf); len(errs) > 0 {
|
||||
|
|
|
@ -24,7 +24,7 @@ type stsDecoder interface {
|
|||
func decodeAWSError(decoder stsDecoder, err error) error {
|
||||
|
||||
groups := encodedFailureMessagePattern.FindStringSubmatch(err.Error())
|
||||
if groups != nil && len(groups) > 1 {
|
||||
if len(groups) > 1 {
|
||||
result, decodeErr := decoder.DecodeAuthorizationMessage(&sts.DecodeAuthorizationMessageInput{
|
||||
EncodedMessage: aws.String(groups[2]),
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue