From 30293ad98fedb6360fe05f9e70b9e5947ac6e7ca Mon Sep 17 00:00:00 2001 From: Obeyda Djeffal Date: Fri, 1 Feb 2019 18:13:06 +0100 Subject: [PATCH] fix(kitgen): normalize backSlashes in path add filepath.ToSlash() to convert backSlashes to forward slashes in path fixes: #740 --- cmd/kitgen/ast_helpers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/kitgen/ast_helpers.go b/cmd/kitgen/ast_helpers.go index ab7c277db..20b595792 100644 --- a/cmd/kitgen/ast_helpers.go +++ b/cmd/kitgen/ast_helpers.go @@ -5,6 +5,7 @@ import ( "go/ast" "go/parser" "go/token" + "path/filepath" "strings" "unicode" ) @@ -204,5 +205,5 @@ func importFor(is *ast.ImportSpec) *ast.GenDecl { } func importSpec(path string) *ast.ImportSpec { - return &ast.ImportSpec{Path: &ast.BasicLit{Kind: token.STRING, Value: `"` + path + `"`}} + return &ast.ImportSpec{Path: &ast.BasicLit{Kind: token.STRING, Value: `"` + filepath.ToSlash(path) + `"`}} }