From e15bd7a59a07427d7d7dec5915ff69f9613dc04e Mon Sep 17 00:00:00 2001 From: sadiq1971 Date: Wed, 26 Feb 2025 17:05:53 +0600 Subject: [PATCH] fix: find go root algo --- common/common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/common.go b/common/common.go index 6199e5f..e4c2a98 100644 --- a/common/common.go +++ b/common/common.go @@ -9,7 +9,7 @@ import ( // FindGoModuleRoot finds the Go module root directory by searching for `go.mod` func FindGoModuleRoot(target string) (string, error) { - dir := filepath.Dir(target) + dir := filepath.Clean(target) for { if _, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil { return dir, nil // Found go.mod, return this directory as module root