From 76e9045bc058e9668a0bc7ad2de83dd6a61d5ea4 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 29 May 2015 11:26:07 -0700 Subject: [PATCH] post-processor/atlas: find common prefix on Windows [GH-1874] --- post-processor/atlas/util.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/post-processor/atlas/util.go b/post-processor/atlas/util.go index 1c0bfa27f..0a26d05a4 100644 --- a/post-processor/atlas/util.go +++ b/post-processor/atlas/util.go @@ -2,6 +2,7 @@ package atlas import ( "math" + "path/filepath" "strings" ) @@ -26,12 +27,12 @@ func longestCommonPrefix(vs []string) string { // short string, which itself must contain the prefix. for i := len(shortest); i > 0; i-- { // We only care about prefixes with path seps - if shortest[i-1] != '/' { + if shortest[i-1] != filepath.Separator { continue } bad := false - prefix := shortest[0 : i] + prefix := shortest[0:i] for _, v := range vs { if !strings.HasPrefix(v, prefix) { bad = true