Skip to content

Commit

Permalink
Use static strings for enums
Browse files Browse the repository at this point in the history
  • Loading branch information
skmcgrail authored and jasdel committed Dec 23, 2020
1 parent 7ca5d89 commit d1a795c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion feature/dynamodb/expression/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func ExampleBuilder_WithUpdate() {
"Artist": &types.AttributeValueMemberS{Value: "Acme Band"},
"SongTitle": &types.AttributeValueMemberS{Value: "Happy Day"},
},
ReturnValues: types.ReturnValueAllNew,
ReturnValues: "ALL_NEW",
TableName: aws.String("Music"),
UpdateExpression: expr.Update(),
}
Expand Down
8 changes: 4 additions & 4 deletions feature/s3/manager/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestUploadOrderMulti(t *testing.T) {
Bucket: aws.String("Bucket"),
Key: aws.String("Key - value"),
Body: bytes.NewReader(buf12MB),
ServerSideEncryption: types.ServerSideEncryptionAwsKms,
ServerSideEncryption: "aws:kms",
SSEKMSKeyId: aws.String("KmsId"),
ContentType: aws.String("content/type"),
})
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestUploadOrderMulti(t *testing.T) {
// Custom headers
cmu := (*args)[0].(*s3.CreateMultipartUploadInput)

if e, a := types.ServerSideEncryptionAwsKms, cmu.ServerSideEncryption; e != a {
if e, a := types.ServerSideEncryption("aws:kms"), cmu.ServerSideEncryption; e != a {
t.Errorf("expect %q, got %q", e, a)
}

Expand Down Expand Up @@ -208,7 +208,7 @@ func TestUploadOrderSingle(t *testing.T) {
Bucket: aws.String("Bucket"),
Key: aws.String("Key - value"),
Body: bytes.NewReader(buf2MB),
ServerSideEncryption: types.ServerSideEncryptionAwsKms,
ServerSideEncryption: "aws:kms",
SSEKMSKeyId: aws.String("KmsId"),
ContentType: aws.String("content/type"),
})
Expand All @@ -235,7 +235,7 @@ func TestUploadOrderSingle(t *testing.T) {

putObjectInput := (*params)[0].(*s3.PutObjectInput)

if e, a := types.ServerSideEncryptionAwsKms, putObjectInput.ServerSideEncryption; e != a {
if e, a := types.ServerSideEncryption("aws:kms"), putObjectInput.ServerSideEncryption; e != a {
t.Errorf("expect %q, got %q", e, a)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func SetupBucket(ctx context.Context, svc *s3.Client, bucketName string) (err er
_, err = svc.CreateBucket(ctx, &s3.CreateBucketInput{
Bucket: &bucketName,
CreateBucketConfiguration: &types.CreateBucketConfiguration{
LocationConstraint: types.BucketLocationConstraintUsWest2,
LocationConstraint: "us-west-2",
},
})
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions service/s3/internal/customizations/handle_200_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/aws/aws-sdk-go-v2/internal/awstesting/unit"

"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
)

type EndpointResolverFunc func(region string, options s3.EndpointResolverOptions) (aws.Endpoint, error)
Expand Down Expand Up @@ -84,7 +83,7 @@ func TestErrorResponseWith200StatusCode(t *testing.T) {
svc := s3.New(options)
resp, err := svc.CompleteMultipartUpload(context.Background(), &s3.CompleteMultipartUploadInput{
UploadId: aws.String("mockID"),
RequestPayer: types.RequestPayerRequester,
RequestPayer: "requester",
Bucket: aws.String("bucket"),
Key: aws.String("mockKey"),
})
Expand Down

0 comments on commit d1a795c

Please sign in to comment.