()
| 56 | } |
| 57 | |
| 58 | func findRepoRoot() (string, error) { |
| 59 | dir, err := os.Getwd() |
| 60 | if err != nil { |
| 61 | return "", err |
| 62 | } |
| 63 | |
| 64 | for { |
| 65 | if fileutil.FileExists(filepath.Join(dir, "go.mod")) && fileutil.FileExists(filepath.Join(dir, "Makefile")) { |
| 66 | return dir, nil |
| 67 | } |
| 68 | parent := filepath.Dir(dir) |
| 69 | if parent == dir { |
| 70 | return "", fmt.Errorf("repository root not found from %s", dir) |
| 71 | } |
| 72 | dir = parent |
| 73 | } |
| 74 | } |
no test coverage detected