Skip to content

Commit

Permalink
add bucket name as args (#318)
Browse files Browse the repository at this point in the history
Co-authored-by: 文徐 <[email protected]>
  • Loading branch information
wenxuwan and wenxuwan authored Nov 16, 2021
1 parent c608d04 commit f36148a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions demo/file/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestList(bucketName string) {
marker = resp.Marker
if !resp.IsTruncated {
fmt.Printf("files under bucket is: %+v, %+v \n", resp.Files, marker)
fmt.Printf("finish list")
fmt.Printf("finish list \n")
return
}
fmt.Printf("files under bucket is: %+v, %+v \n", resp.Files, marker)
Expand All @@ -109,10 +109,10 @@ func TestDel(fileName string) {
listReq := &runtimev1pb.DelFileRequest{Request: req}
_, err = c.DelFile(context.Background(), listReq)
if err != nil {
fmt.Printf("list file fail, err: %+v", err)
fmt.Printf("list file fail, err: %+v \n", err)
return
}
fmt.Printf("delete file success")
fmt.Printf("delete file success \n")
}

func TestStat(fileName string) {
Expand Down Expand Up @@ -146,7 +146,7 @@ func TestStat(fileName string) {

}

func CreateBucket() {
func CreateBucket(bn string) {

ctx := context.Background()
endpoint := "play.min.io"
Expand All @@ -164,7 +164,7 @@ func CreateBucket() {
}

// Make a new bucket called mymusic.
bucketName := "wwx"
bucketName := bn
location := "us-west-2"

err = minioClient.MakeBucket(ctx, bucketName, minio.MakeBucketOptions{Region: location})
Expand Down Expand Up @@ -203,6 +203,6 @@ func main() {
TestStat(os.Args[2])
}
if os.Args[1] == "bucket" {
CreateBucket()
CreateBucket(os.Args[2])
}
}

0 comments on commit f36148a

Please sign in to comment.