From c9c00e00726aa55fb6edcdff7929845b8234262c Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Tue, 23 Nov 2021 13:35:18 -0800 Subject: [PATCH] Allow multiple paths in mkdir and remove --- api/fs.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/fs.go b/api/fs.go index 5235f69..edb4eb0 100644 --- a/api/fs.go +++ b/api/fs.go @@ -19,12 +19,12 @@ func (c *Client) Rename(old, new string) error { return nil } -func (c *Client) Remove(path string) error { +func (c *Client) Remove(paths ...string) error { _, err := c.request(types.Request{ Type: types.ReqTypeFS, Data: types.ReqDataFS{ Type: types.FSTypeDelete, - Files: []string{path}, + Files: paths, }, }) if err != nil { @@ -33,12 +33,12 @@ func (c *Client) Remove(path string) error { return nil } -func (c *Client) Mkdir(path string) error { +func (c *Client) Mkdir(paths ...string) error { _, err := c.request(types.Request{ Type: types.ReqTypeFS, Data: types.ReqDataFS{ Type: types.FSTypeMkdir, - Files: []string{path}, + Files: paths, }, }) if err != nil { @@ -86,7 +86,7 @@ func (c *Client) WriteFile(path, data string) error { Data: types.ReqDataFS{ Type: types.FSTypeRead, Files: []string{path}, - Data: data, + Data: data, }, }) if err != nil {