From 9e2acd491b91e845458938379437b424aa88e935 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Fri, 24 Oct 2014 11:30:08 +0200 Subject: [PATCH] fix Mkdir signature --- client.go | 11 ++++------- main/client.go | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/client.go b/client.go index ec6cf93..a828436 100644 --- a/client.go +++ b/client.go @@ -133,20 +133,17 @@ func (c *Client) Remove(path string) error { } } -func (c *Client) Mkdir(path string) error { +func (c *Client) Mkdir(path string, _ os.FileMode) error { path = FixSlashes(path) status := c.mkcol(path) if status == 201 { return nil + } else { + return newPathError("Mkdir", path, status) } - - if status == 409 { - // TODO - } - - return errors.New(fmt.Sprintf("%d", status)) } + func (c *Client) Read(path string) { fmt.Println("Read " + path) } diff --git a/main/client.go b/main/client.go index 019414d..8d07d65 100644 --- a/main/client.go +++ b/main/client.go @@ -61,7 +61,7 @@ func main() { } case "MKCOL", "MKDIR": - if err := c.Mkdir(path); err != nil { + if err := c.Mkdir(path, 0); err != nil { fmt.Println(err) } else { fmt.Println("MkDir: " + path)