Skip to content

Commit 51a0873

Browse files
authored
fix: find go root algo (#40)
1 parent 68ab4ed commit 51a0873

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

common/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
// FindGoModuleRoot finds the Go module root directory by searching for `go.mod`
1111
func FindGoModuleRoot(target string) (string, error) {
12-
dir := filepath.Dir(target)
12+
dir := filepath.Clean(target)
1313
for {
1414
if _, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil {
1515
return dir, nil // Found go.mod, return this directory as module root

0 commit comments

Comments
 (0)