Skip to content

Commit 444ae1f

Browse files
committed
Switch to path based style
1 parent db7eb19 commit 444ae1f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ func configureS3(s3Config *S3Config) *s3.S3 {
203203
}
204204

205205
sess, err := session.NewSession(&aws.Config{
206+
S3ForcePathStyle: aws.Bool(true),
206207
Region: aws.String(s3Config.Region),
207208
Credentials: credentials.NewStaticCredentials(s3Config.AccessKey, s3Config.SecretKey, ""),
208209
Endpoint: aws.String(s3Config.Endpoint),
@@ -217,11 +218,17 @@ func configureS3(s3Config *S3Config) *s3.S3 {
217218

218219
// Test the S3 connection by making a simple ListBuckets request
219220
func testS3Connection(s3Svc *s3.S3) bool {
220-
_, err := s3Svc.ListBuckets(&s3.ListBucketsInput{})
221+
result, err := s3Svc.ListBuckets(&s3.ListBucketsInput{})
221222
if err != nil {
222223
log.Printf("Failed to connect to S3: %v", err)
223224
return false
224225
}
226+
227+
log.Println("Successfully connected to S3. Buckets:")
228+
for _, bucket := range result.Buckets {
229+
log.Printf(" Present Buckets %s", aws.StringValue(bucket.Name))
230+
}
231+
225232
return true
226233
}
227234
// Example upload function (not used in connection test)

0 commit comments

Comments
 (0)