Skip to content

Commit

Permalink
fixed b2 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
clgillis committed Sep 13, 2018
1 parent 63c2857 commit 2056054
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions b2.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (c *Client) doRequest(endpoint string, params map[string]interface{}) (*htt
return nil, err
}
// Reduce debug log noise
delete(params, "accountID")
// delete(params, "accountID")
delete(params, "bucketID")

apiURL := c.loginInfo.Load().(*LoginInfo).ApiURL
Expand Down Expand Up @@ -298,7 +298,7 @@ func (c *Client) BucketByID(id string) *Bucket {
// found and createIfNotExists is true, CreateBucket is called with allPublic set
// to false. Otherwise, an error is returned.
func (c *Client) BucketByName(name string, createIfNotExists bool) (*BucketInfo, error) {
bs, err := c.Buckets()
bs, err := c.Buckets(name)
if err != nil {
return nil, err
}
Expand All @@ -314,9 +314,10 @@ func (c *Client) BucketByName(name string, createIfNotExists bool) (*BucketInfo,
}

// Buckets returns a list of buckets sorted by name.
func (c *Client) Buckets() ([]*BucketInfo, error) {
func (c *Client) Buckets(name string) ([]*BucketInfo, error) {
res, err := c.doRequest("b2_list_buckets", map[string]interface{}{
"accountId": c.loginInfo.Load().(*LoginInfo).AccountID,
"bucketName": name,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 2056054

Please sign in to comment.