fix: migrate aws/credentials.go to use NewSession, same functionality but now supports error #9878
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withNewSession
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 deprecatedNew
for better error handling.