From: Bjørn Erik Pedersen Date: Mon, 23 Nov 2015 21:35:54 +0000 (+0100) Subject: Simplify ExtractRootPaths X-Git-Tag: v0.15~15 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b00771ca14ef0b07a1eb6cf71e2511e12b02d0b0;p=brevno-suite%2Fhugo Simplify ExtractRootPaths --- diff --git a/helpers/path.go b/helpers/path.go index 07d08fa6..7fb116a7 100644 --- a/helpers/path.go +++ b/helpers/path.go @@ -458,13 +458,11 @@ func ExtractRootPaths(paths []string) []string { r := make([]string, len(paths)) for i, p := range paths { root := filepath.ToSlash(p) - if strings.Contains(root, "/") { - sections := strings.Split(root, "/") - for _, section := range sections { - if section != "" { - root = section - break - } + sections := strings.Split(root, "/") + for _, section := range sections { + if section != "" { + root = section + break } } r[i] = root