diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ninjacloud.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/ninjacloud.go b/src/ninjacloud.go index c3e5322..0915e40 100644 --- a/src/ninjacloud.go +++ b/src/ninjacloud.go | |||
@@ -233,7 +233,6 @@ func listDir(path string, recursive bool, filter []string, returnType string) (l | |||
233 | modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10) | 233 | modTime := strconv.FormatInt(d.ModTime().UnixNano(), 10) |
234 | modTime = modTime[:len(modTime)-6] | 234 | modTime = modTime[:len(modTime)-6] |
235 | uri := filepath.Clean(path + "/" + d.Name()) | 235 | uri := filepath.Clean(path + "/" + d.Name()) |
236 | list = append(list, element{}) | ||
237 | e.Type = "directory" | 236 | e.Type = "directory" |
238 | e.Name = d.Name() | 237 | e.Name = d.Name() |
239 | e.Uri = filepath.Clean(drivePrefix + uri) | 238 | e.Uri = filepath.Clean(drivePrefix + uri) |
@@ -249,11 +248,7 @@ func listDir(path string, recursive bool, filter []string, returnType string) (l | |||
249 | } else { | 248 | } else { |
250 | e.Children = nil | 249 | e.Children = nil |
251 | } | 250 | } |
252 | if cap(list) > 1 { | 251 | list = append(list, e) |
253 | list = append(list, e) | ||
254 | } else { | ||
255 | list[0] = e | ||
256 | } | ||
257 | } else if !d.IsDir() && returnFiles { | 252 | } else if !d.IsDir() && returnFiles { |
258 | ext := filepath.Ext(d.Name()) | 253 | ext := filepath.Ext(d.Name()) |
259 | if ext != "" { | 254 | if ext != "" { |