()
| 58 | } |
| 59 | |
| 60 | func findProjectRoot() string { |
| 61 | // Walk up from the test file to find go.mod |
| 62 | dir, _ := os.Getwd() |
| 63 | for { |
| 64 | if _, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil { |
| 65 | return dir |
| 66 | } |
| 67 | parent := filepath.Dir(dir) |
| 68 | if parent == dir { |
| 69 | log.Fatal("Could not find project root (go.mod)") |
| 70 | } |
| 71 | dir = parent |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | // --------------------------------------------------------------------------- |
| 76 | // syncBuffer — thread-safe byte buffer for capturing subprocess logs |