Quellcode durchsuchen

fix windows bug

kingxt vor 4 Jahren
Ursprung
Commit
fd75f700a2
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3 0
      tools/goctl/api/gogen/util.go

+ 3 - 0
tools/goctl/api/gogen/util.go

@@ -28,6 +28,9 @@ func getParentPackage(dir string) (string, error) {
 	var tempPath = absDir
 	var hasGoMod = false
 	for {
+		if tempPath == filepath.Dir(tempPath) {
+			break
+		}
 		tempPath = filepath.Dir(tempPath)
 		if goctlutil.FileExists(filepath.Join(tempPath, goModeIdentifier)) {
 			tempPath = filepath.Dir(tempPath)