From 97227a5c70630920af1d1d352dace5f3c90b26c5 Mon Sep 17 00:00:00 2001 From: Emil Hessman Date: Wed, 28 Jan 2015 10:40:19 +0100 Subject: [PATCH] config/module: fix detection of file paths on Windows Absolute file paths were not correctly detected by module.Detect when using url.Parse to parse the source URL. Wrap the detection with urlParse to properly handle file path detections on Windows. Fixes command test failures on Windows. --- config/module/detect.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/module/detect.go b/config/module/detect.go index bdf54f9f80..f70e69a478 100644 --- a/config/module/detect.go +++ b/config/module/detect.go @@ -38,10 +38,10 @@ func Detect(src string, pwd string) (string, error) { // Separate out the subdir if there is one, we don't pass that to detect getSrc, subDir := getDirSubdir(getSrc) - u, err := url.Parse(getSrc) + u, err := urlParse(getSrc) if err == nil && u.Scheme != "" { // Valid URL - return src, nil + return u.String(), nil } for _, d := range Detectors {