Skip to content

Commit ed47a94

Browse files
committed
Fix import paths using windows path separators (fixes #129)
1 parent dce9f7c commit ed47a94

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)