Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove credentials parsing and let the SDK handle it #250

Closed
wants to merge 1 commit into from

Conversation

rhyas
Copy link

@rhyas rhyas commented Jan 10, 2018

Just a simple PR to let the SDK do the work of finding a profile/credentials.

}
profile := c.String("profile")
if profile != "" {
sess := session.Must(session.NewSessionWithOptions(session.Options{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

session.Must isn't right here - it forces a panic on error. getService should return the error so it can be presented to the user in a friendly manner.

}))
return route53.New(sess), nil
} else {
sess := session.Must(session.NewSessionWithOptions(session.Options{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole block of code is duplicated in both branches of the condition - when in fact it should just set .Profile on session.Options when profile != ""

}
return route53.New(session.New(), config), nil
}
profile := c.String("profile")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation needs fixing on the code - please run gofmt

@barnybug barnybug closed this in c3615c8 Jan 12, 2018
@rhyas
Copy link
Author

rhyas commented Jan 13, 2018

Thanks for the cleanup! (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants