hub/internal/probe/helpers_test.go
trvon 0d7a219c5d
Some checks failed
release / build (push) Failing after 2m13s
hub: operator CLI with signed self-update
2026-11-10 20:32:32 -07:00

19 lines
342 B
Go

// SPDX-License-Identifier: GPL-3.0-or-later
package probe_test
import (
"bytes"
"encoding/json"
"testing"
)
// minify compacts JSON to one line, like the probe prints it.
func minify(t *testing.T, raw []byte) []byte {
t.Helper()
var b bytes.Buffer
if err := json.Compact(&b, raw); err != nil {
t.Fatal(err)
}
return b.Bytes()
}