We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68ab4ed commit 51a0873Copy full SHA for 51a0873
1 file changed
common/common.go
@@ -9,7 +9,7 @@ import (
9
10
// FindGoModuleRoot finds the Go module root directory by searching for `go.mod`
11
func FindGoModuleRoot(target string) (string, error) {
12
- dir := filepath.Dir(target)
+ dir := filepath.Clean(target)
13
for {
14
if _, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil {
15
return dir, nil // Found go.mod, return this directory as module root
0 commit comments