fix(kitgen): normalize backSlashes in path (#831)
add filepath.ToSlash() to convert backSlashes to forward slashes in path
fixes: #740
Obeyda Djeffal authored 5 years ago
Peter Bourgon committed 5 years ago
4 | 4 | "go/ast" |
5 | 5 | "go/parser" |
6 | 6 | "go/token" |
7 | "path/filepath" | |
7 | 8 | "strings" |
8 | 9 | "unicode" |
9 | 10 | ) |
203 | 204 | } |
204 | 205 | |
205 | 206 | func importSpec(path string) *ast.ImportSpec { |
206 | return &ast.ImportSpec{Path: &ast.BasicLit{Kind: token.STRING, Value: `"` + path + `"`}} | |
207 | } | |
207 | return &ast.ImportSpec{Path: &ast.BasicLit{Kind: token.STRING, Value: `"` + filepath.ToSlash(path) + `"`}} | |
208 | } |