From fd75f700a2fa2592f3d813f87ad529eaf647e076 Mon Sep 17 00:00:00 2001 From: kingxt Date: Wed, 12 Aug 2020 10:23:49 +0800 Subject: [PATCH] fix windows bug --- tools/goctl/api/gogen/util.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/goctl/api/gogen/util.go b/tools/goctl/api/gogen/util.go index 44d8a6fd..1306d1b8 100644 --- a/tools/goctl/api/gogen/util.go +++ b/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)