title: How to get list of objects from sub folder of Amazon S3 bucket using golang?
body: <p>How do I get the list of objects from a sub folder of an Amazon S3 bucket using golang?</p>
  
  <p>I tried:</p>
  
  <pre><code>svc := s3.New(session.New(), &amp;aws.Config{Region: aws.String("us-east-1")})
  
  params := &amp;s3.ListObjectsInput{
      Bucket: aws.String("bucket"),
  }
  
  resp, _ := svc.ListObjects(params)
  for _, key := range resp.Contents {
      fmt.Println(*key.Key)
  }
  </code></pre>
  
  <p>I got the list of all the objects in the bucket, but I need only the list of objects in a subfolder.</p>