Skip to content

Commit 1bbcacb

Browse files
authored
fix: fix outdated config initialization (#83)
1 parent 8472d5b commit 1bbcacb

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

docs/developer/sdk/go.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,12 @@ if access_key_id == "" || secret_access_key == "" || region == "" || endpoint ==
3030
// build aws.Config
3131
cfg := aws.Config{
3232
Region: region,
33-
EndpointResolver: aws.EndpointResolverFunc(func(service, region string) (aws.Endpoint, error) {
34-
return aws.Endpoint{
35-
URL: endpoint,
36-
}, nil
37-
}),
3833
Credentials: aws.NewCredentialsCache(credentials.NewStaticCredentialsProvider(access_key_id, secret_access_key, "")),
3934
}
4035

4136
// build S3 client
4237
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
38+
o.BaseEndpoint = aws.String(endpoint)
4339
o.UsePathStyle = true
4440
})
4541
```

0 commit comments

Comments
 (0)