From 4b95ff312e23d525a2c537b6e5012d5bf12a5f89 Mon Sep 17 00:00:00 2001 From: Jonathan Rudenberg Date: Wed, 25 Mar 2015 15:15:25 -0700 Subject: [PATCH] util: Use path instead of filepath in HashedPaths filepath is incorrect here, as we should always use forward slashes, even on Windows. Signed-off-by: Jonathan Rudenberg --- util/util.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/util.go b/util/util.go index fc830a90..31612f87 100644 --- a/util/util.go +++ b/util/util.go @@ -11,7 +11,6 @@ import ( "io" "io/ioutil" "path" - "path/filepath" "strings" "github.com/flynn/go-tuf/data" @@ -116,10 +115,10 @@ func NormalizeTarget(p string) string { return "/" + s } -func HashedPaths(path string, hashes data.Hashes) []string { +func HashedPaths(p string, hashes data.Hashes) []string { paths := make([]string, 0, len(hashes)) for _, hash := range hashes { - hashedPath := filepath.Join(filepath.Dir(path), hash.String()+"."+filepath.Base(path)) + hashedPath := path.Join(path.Dir(p), hash.String()+"."+path.Base(p)) paths = append(paths, hashedPath) } return paths