From fdefaa55ad4daad948c96730bbaafb86012dc4cb Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Tue, 9 Mar 2021 13:51:13 -0800 Subject: [PATCH] Use platform-aware filepath.Join instead of path.Join --- pkg/util/util.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/util/util.go b/pkg/util/util.go index 7e5b79a3fa..6884dea4bb 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -20,7 +20,6 @@ import ( "fmt" "net/url" "os" - "path" "path/filepath" "strings" @@ -59,13 +58,13 @@ func ParseEndpoint(endpoint string) (string, string, error) { return "", "", fmt.Errorf("could not parse endpoint: %v", err) } - addr := path.Join(u.Host, filepath.FromSlash(u.Path)) + addr := filepath.Join(u.Host, filepath.FromSlash(u.Path)) scheme := strings.ToLower(u.Scheme) switch scheme { case "tcp": case "unix": - addr = path.Join("/", addr) + addr = filepath.Join("/", addr) if err := os.Remove(addr); err != nil && !os.IsNotExist(err) { return "", "", fmt.Errorf("could not remove unix domain socket %q: %v", addr, err) }