go - How to get list of objects from sub folder of Amazon S3 bucket using golang? -


how list of objects sub folder of amazon s3 bucket using golang?

i tried:

svc := s3.new(session.new(), &aws.config{region: aws.string("us-east-1")})  params := &s3.listobjectsinput{     bucket: aws.string("bucket"), }  resp, _ := svc.listobjects(params) _, key := range resp.contents {     fmt.println(*key.key) } 

i got list of objects in bucket, need list of objects in subfolder.

add prefix parameter in params

params := &s3.listobjectsinput {     bucket: aws.string("bucket"),     prefix: aws.string("root/subfolder"), } 

will list objects subfolder/


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -