mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 20:15:07 +00:00
feat: add JSON output tests and README docs for analyze and status (#556)
* feat: add JSON output tests and README docs for analyze and status Add 7 BATS tests covering `--json` output for `mo analyze` and `mo status`: - schema structure - field types - pipe auto-detection. Also document the `--json` flag in a new "Machine-Readable Output" README section, including the auto-detection behavior when piped. * chore: use waitgroup go in status collector --------- Co-authored-by: Tw93 <hitw93@gmail.com>
This commit is contained in:
@@ -255,9 +255,7 @@ func (c *Collector) Collect() (MetricsSnapshot, error) {
|
||||
|
||||
// Helper to launch concurrent collection.
|
||||
collect := func(fn func() error) {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
errMu.Lock()
|
||||
@@ -279,7 +277,7 @@ func (c *Collector) Collect() (MetricsSnapshot, error) {
|
||||
}
|
||||
errMu.Unlock()
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
// Launch independent collection tasks.
|
||||
|
||||
Reference in New Issue
Block a user