From 8faf9e3d75445fb4955f7b173ad68ec67f2dcb9f Mon Sep 17 00:00:00 2001 From: Ludovic Fauvet Date: Fri, 13 Jan 2017 13:06:58 +0100 Subject: [PATCH] Pre-allocate the exact number of slice to be returned --- ftp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftp.go b/ftp.go index 6eb30cb..160b71e 100644 --- a/ftp.go +++ b/ftp.go @@ -340,7 +340,7 @@ func parseRFC3659ListLine(line string) (*Entry, error) { // parse file or folder name with starting or containing multiple whitespaces func fieldsLsList(s string) []string { n := 8 - fields := make([]string, 0, n) + fields := make([]string, 0, n+1) fieldStart := -1 nextbreak := false for i, c := range s {