From b00771ca14ef0b07a1eb6cf71e2511e12b02d0b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 23 Nov 2015 22:35:54 +0100 Subject: [PATCH] Simplify ExtractRootPaths --- helpers/path.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/helpers/path.go b/helpers/path.go index 07d08fa69..7fb116a77 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