make guard clauses to clearly see success pass

This commit is contained in:
Adrien Delorme 2019-01-25 13:00:21 +01:00
parent 0864b4d07b
commit 54af9951a8
1 changed files with 16 additions and 16 deletions

View File

@ -84,9 +84,10 @@ func (c *AccessConfig) Session() (*session.Session, error) {
}
}
if sess, err := session.NewSessionWithOptions(opts); err != nil {
sess, err := session.NewSessionWithOptions(opts)
if err != nil {
return nil, err
} else {
}
log.Printf("Found region %s", *sess.Config.Region)
c.session = sess
@ -101,7 +102,6 @@ func (c *AccessConfig) Session() (*session.Session, error) {
}
}
log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName)
}
if c.DecodeAuthZMessages {
DecodeAuthZMessages(c.session)