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

fix: migrate aws/credentials.go to use NewSession, same functionality but now supports error #9878

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

sspaink
Copy link
Contributor

@sspaink sspaink commented Oct 7, 2021

session.New is deprecated: Use NewSession functions to create sessions instead. NewSession has the same functionality as New except an error can be returned when the func is called instead of waiting to receive an error until a request is made.

The above is the exact message from the linter, noticed it was reporting that session.New was deprecated. Easy resolution is to replace it with NewSession and propagate the newly returned error. Found a little bit more info here: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/sessions.html, but it just re-iterates the linter message that they deprecated New for better error handling.

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Oct 7, 2021
@sspaink sspaink added the area/aws AWS plugins including cloudwatch, ecs, kinesis label Oct 7, 2021
@sspaink sspaink merged commit fde6374 into master Oct 7, 2021
@sspaink sspaink deleted the newsessionaws branch October 7, 2021 20:47
reimda pushed a commit that referenced this pull request Oct 7, 2021
… but now supports error (#9878)

(cherry picked from commit fde6374)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/aws AWS plugins including cloudwatch, ecs, kinesis fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants