File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -42,22 +42,14 @@ func init() {
4242}
4343
4444func 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 ())
5746 if err != nil {
5847 fmt .Fprintf (os .Stderr , "could not load AWS config: %v\n " , err )
5948 os .Exit (2 )
6049 }
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+ })
6355}
You can’t perform that action at this time.
0 commit comments