From 2b41f05848c4a203624791ca0e9030deda2dd1f5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 3 Aug 2013 13:38:27 -0700 Subject: [PATCH] common: replace windows file URL backslash with forward slash /cc @jasonberanek - Just adding this as well because I see this being common as well. --- common/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/config.go b/common/config.go index ff173423f..16ab86252 100644 --- a/common/config.go +++ b/common/config.go @@ -78,6 +78,11 @@ func DownloadableURL(original string) (string, error) { // since net/url turns "C:/" into "/C:/" if runtime.GOOS == "windows" && url.Path[0] == '/' { url.Path = url.Path[1:len(url.Path)] + + // Also replace all backslashes with forwardslashes since Windows + // users are likely to do this but the URL should actually only + // contain forward slashes. + url.Path = strings.Replace(url.Path, `\`, `/`, -1) } if _, err := os.Stat(url.Path); err != nil {