diff --git a/tools/goctl/util/path.go b/tools/goctl/util/path.go index 55520b2c..d0f32f80 100644 --- a/tools/goctl/util/path.go +++ b/tools/goctl/util/path.go @@ -61,7 +61,7 @@ func FindGoModPath(dir string) (string, bool) { for { if FileExists(filepath.Join(tempPath, goModeIdentifier)) { tempPath = filepath.Dir(tempPath) - rootPath = absDir[len(tempPath)+1:] + rootPath = strings.TrimPrefix(absDir[len(tempPath):], "/") hasGoMod = true break }