From 1669f660c0bf1d7e8ca56446767852bf0831cfdf Mon Sep 17 00:00:00 2001 From: CCI_elmasm Date: Tue, 27 Feb 2018 10:44:13 +0000 Subject: [PATCH] importPathRoot function can now support linux and windows file path syntax --- cmd/generate-fix/internal/helpers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/generate-fix/internal/helpers.go b/cmd/generate-fix/internal/helpers.go index 13d94bf7f..7b4a96fe1 100644 --- a/cmd/generate-fix/internal/helpers.go +++ b/cmd/generate-fix/internal/helpers.go @@ -2,7 +2,7 @@ package internal import ( "os" - "path" + "path/filepath" "strings" ) @@ -15,7 +15,7 @@ func getImportPathRoot() string { if err != nil { panic(err) } - goSrcPath := path.Join(os.Getenv("GOPATH"), "src") - importPathRoot := strings.Replace(pwd, goSrcPath, "", 1) + goSrcPath := filepath.Join(os.Getenv("GOPATH"), "src") + importPathRoot := filepath.ToSlash(strings.Replace(pwd, goSrcPath, "", 1)) return strings.TrimLeft(importPathRoot, "/") -} +} \ No newline at end of file