mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-21 03:44:24 +08:00
fix listObjectsV2 response format
fix https://github.com/chrislusf/seaweedfs/issues/1426 issue 1
This commit is contained in:
@@ -61,7 +61,7 @@ func TestCreateBucket(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestListBuckets(t *testing.T) {
|
||||
func TestPutObject(t *testing.T) {
|
||||
|
||||
input := &s3.PutObjectInput{
|
||||
ACL: aws.String("authenticated-read"),
|
||||
@@ -89,7 +89,7 @@ func TestListBuckets(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestPutObject(t *testing.T) {
|
||||
func TestListBucket(t *testing.T) {
|
||||
|
||||
result, err := svc.ListBuckets(nil)
|
||||
if err != nil {
|
||||
@@ -105,6 +105,23 @@ func TestPutObject(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestListObjectV2(t *testing.T) {
|
||||
|
||||
listObj, err := svc.ListObjectsV2(&s3.ListObjectsV2Input{
|
||||
Bucket: aws.String(Bucket),
|
||||
Prefix: aws.String("foo"),
|
||||
Delimiter: aws.String("/"),
|
||||
})
|
||||
if err != nil {
|
||||
exitErrorf("Unable to list objects, %v", err)
|
||||
}
|
||||
for _, content := range listObj.Contents {
|
||||
fmt.Println(aws.StringValue(content.Key))
|
||||
}
|
||||
fmt.Printf("list: %s\n", listObj)
|
||||
|
||||
}
|
||||
|
||||
func exitErrorf(msg string, args ...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, msg+"\n", args...)
|
||||
os.Exit(1)
|
||||
|
Reference in New Issue
Block a user