From ae493bcc9f382acdafd4050f374d97aa57bdc21e Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 6 May 2015 12:04:40 -0700 Subject: [PATCH] path.Join("/") does everything required in Normalize Signed-off-by: David Lawrence (github: endophage) --- util/util.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/util/util.go b/util/util.go index 31612f87..27de8282 100644 --- a/util/util.go +++ b/util/util.go @@ -11,7 +11,6 @@ import ( "io" "io/ioutil" "path" - "strings" "github.com/flynn/go-tuf/data" ) @@ -105,14 +104,7 @@ func GenerateFileMeta(r io.Reader, hashAlgorithms ...string) (data.FileMeta, err } func NormalizeTarget(p string) string { - if p == "" { - return "/" - } - s := path.Clean(p) - if strings.HasPrefix(s, "/") { - return s - } - return "/" + s + return path.Join("/", p) } func HashedPaths(p string, hashes data.Hashes) []string {