From 9f92709ce75943415d19980aea3c364f51bc7642 Mon Sep 17 00:00:00 2001 From: Jonathan Rudenberg Date: Wed, 25 Mar 2015 14:28:10 -0700 Subject: [PATCH] util: Use path instead of filepath for NormalizePath This avoids using the wrong slash on Windows. Signed-off-by: Jonathan Rudenberg --- util/util.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/util.go b/util/util.go index 1252b924..fc830a90 100644 --- a/util/util.go +++ b/util/util.go @@ -10,6 +10,7 @@ import ( "hash" "io" "io/ioutil" + "path" "path/filepath" "strings" @@ -104,11 +105,11 @@ func GenerateFileMeta(r io.Reader, hashAlgorithms ...string) (data.FileMeta, err return m, nil } -func NormalizeTarget(path string) string { - if path == "" { +func NormalizeTarget(p string) string { + if p == "" { return "/" } - s := filepath.Clean(path) + s := path.Clean(p) if strings.HasPrefix(s, "/") { return s }