Codebase list golang-github-go-kit-kit / 099aba3
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
1 changed file(s) with 3 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
44 "go/ast"
55 "go/parser"
66 "go/token"
7 "path/filepath"
78 "strings"
89 "unicode"
910 )
203204 }
204205
205206 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 }