File tree 1 file changed +6
-14
lines changed
1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -42,22 +42,14 @@ func init() {
42
42
}
43
43
44
44
func getDynamoDB () * dynamodb.Client {
45
- var options []func (* config.LoadOptions ) error
46
- if dynamoDBEndpoint != "" {
47
- options = append (options ,
48
- config .WithEndpointResolverWithOptions (aws .EndpointResolverWithOptionsFunc (
49
- func (_ , _ string , _ ... any ) (aws.Endpoint , error ) {
50
- return aws.Endpoint {URL : dynamoDBEndpoint }, nil
51
- },
52
- )),
53
- )
54
- }
55
-
56
- cfg , err := config .LoadDefaultConfig (context .Background (), options ... )
45
+ cfg , err := config .LoadDefaultConfig (context .Background ())
57
46
if err != nil {
58
47
fmt .Fprintf (os .Stderr , "could not load AWS config: %v\n " , err )
59
48
os .Exit (2 )
60
49
}
61
-
62
- return dynamodb .NewFromConfig (cfg )
50
+ return dynamodb .NewFromConfig (cfg , func (opts * dynamodb.Options ) {
51
+ if dynamoDBEndpoint != "" {
52
+ opts .BaseEndpoint = aws .String (dynamoDBEndpoint )
53
+ }
54
+ })
63
55
}
You can’t perform that action at this time.
0 commit comments