diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2015-11-24 00:35:54 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2015-11-24 00:35:54 +0300 |
commit | b00771ca14ef0b07a1eb6cf71e2511e12b02d0b0 (patch) | |
tree | d22ffee26f560d0df801f31933b6ac5abdfa6669 | |
parent | c3931ef748d1bb0ec60e45e1cecdfc1bde850bfc (diff) |
Simplify ExtractRootPaths
-rw-r--r-- | helpers/path.go | 12 |
1 files 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 |