Skip to content

Commit

Permalink
fix(kitgen): normalize backSlashes in path (#831)
Browse files Browse the repository at this point in the history
add filepath.ToSlash() to convert backSlashes to forward slashes in path

fixes: #740
  • Loading branch information
obeyda authored and peterbourgon committed Feb 1, 2019
1 parent 6b19129 commit 099aba3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/kitgen/ast_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"go/ast"
"go/parser"
"go/token"
"path/filepath"
"strings"
"unicode"
)
Expand Down Expand Up @@ -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) + `"`}}
}

0 comments on commit 099aba3

Please sign in to comment.