Fix the options param to listparts interface

This commit is contained in:
toranger
2019-07-01 11:14:57 +08:00
parent 3ba85d66a2
commit a87afe3e5c
2 changed files with 11 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ func uploadPart(c *cos.Client, name string, uploadID string, blockSize, n int) s
}
func main() {
u, _ := url.Parse("https://test-1253846586.cos.ap-guangzhou.myqcloud.com")
u, _ := url.Parse("http://alangz-1251668577.cos.ap-guangzhou.myqcloud.com")
b := &cos.BaseURL{BucketURL: u}
c := cos.NewClient(b, &http.Client{
Transport: &cos.AuthorizationTransport{
@@ -68,7 +68,10 @@ func main() {
uploadPart(c, name, uploadID, blockSize, i)
}
v, _, err := c.Object.ListParts(ctx, name, uploadID)
// opt := &cos.ObjectListPartsOptions{
// MaxParts: 1,
// }
v, _, err := c.Object.ListParts(ctx, name, uploadID, nil)
if err != nil {
panic(err)
return