Skip to content

Commit 1f0e17e

Browse files
author
Miguel Molina
authored
Merge pull request #133 from JaCoB1123/windows-paths
Fix import paths using windows path separators (fixes #129)
2 parents dce9f7c + ed47a94 commit 1f0e17e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

generator/processor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,9 @@ func typeName(typ types.Type) string {
466466
}
467467

468468
func removeGoPath(path string) string {
469-
return strings.Replace(path, goPath+"/src/", "", -1)
469+
importPath := filepath.ToSlash(goPath + "/src/")
470+
path = filepath.ToSlash(path)
471+
return strings.Replace(path, importPath, "", -1)
470472
}
471473

472474
func isIgnoredField(s *types.Struct, idx int) bool {

0 commit comments

Comments
 (0)