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

Add awsbase.ErrCodeEquals, AWS SDK for Go v2 variant of helper in v2/awsv1shim/tfawserr #524

Merged
merged 4 commits into from
Jun 22, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jun 22, 2023

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Adds an AWS SDK for Go v2 variant of the ErrCodeEquals helper in v2/awsv1shim/tfawserr.
Not all services in the AWS SDK for Go v2 uses strongly-typed, modeled errors (EC2 is top of mind).
To support testing the returned API error code for these servies, add a variant of the ErrCodeEquals helper function defined in v2/awsv1shim/tfawserr that uses the smithy.APIError interface.

% go test ./...
ok  	github.com/hashicorp/aws-sdk-go-base/v2	5.656s
?   	github.com/hashicorp/aws-sdk-go-base/v2/internal/awsconfig	[no test files]
?   	github.com/hashicorp/aws-sdk-go-base/v2/internal/config	[no test files]
?   	github.com/hashicorp/aws-sdk-go-base/v2/internal/constants	[no test files]
ok  	github.com/hashicorp/aws-sdk-go-base/v2/internal/endpoints	0.313s
?   	github.com/hashicorp/aws-sdk-go-base/v2/internal/errs	[no test files]
ok  	github.com/hashicorp/aws-sdk-go-base/v2/internal/expand	0.629s
?   	github.com/hashicorp/aws-sdk-go-base/v2/internal/slices	[no test files]
?   	github.com/hashicorp/aws-sdk-go-base/v2/internal/test	[no test files]
?   	github.com/hashicorp/aws-sdk-go-base/v2/logging	[no test files]
?   	github.com/hashicorp/aws-sdk-go-base/v2/mockdata	[no test files]
?   	github.com/hashicorp/aws-sdk-go-base/v2/servicemocks	[no test files]
ok  	github.com/hashicorp/aws-sdk-go-base/v2/useragent	0.690s

@ewbankkit ewbankkit requested a review from a team as a code owner June 22, 2023 18:04
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@ewbankkit
Copy link
Contributor Author

Will wait for final OK from @gdavison on correct location.

"testing"

"github.com/aws/aws-sdk-go-v2/service/sts/types"
"github.com/aws/aws-sdk-go/aws"
Copy link
Contributor Author

@ewbankkit ewbankkit Jun 22, 2023

Choose a reason for hiding this comment

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

This should be github.com/aws/aws-sdk-go-v2/aws to prevent the go.mod diff.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy and paste :(

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.

3 participants