From a5b6eb39ff9ed992e5bae4340ab4eb848b22c986 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Thu, 23 Oct 2014 13:38:49 +0200 Subject: [PATCH] skip self on ReadDir --- client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client.go b/client.go index 326e0ca..9aa8ed8 100644 --- a/client.go +++ b/client.go @@ -71,8 +71,16 @@ func getProps(r *response, status string) *props { func (c *Client) ReadDir(path string) ([]os.FileInfo, error) { path = FixSlash(path) files := make([]os.FileInfo, 0) + skipSelf := true parse := func(resp interface{}) { r := resp.(*response) + + if skipSelf { + skipSelf = false + r.Props = nil + return + } + if p := getProps(r, "200"); p != nil { f := new(File) f.name = p.Name