From 3294904ee45301d32ee20c03c28587fc1e8b97d1 Mon Sep 17 00:00:00 2001 From: Alex Bucknall Date: Tue, 8 Jul 2025 16:29:34 +0100 Subject: [PATCH] feat: support valid JSON object parsing for -setup --- notecard/scan.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/notecard/scan.go b/notecard/scan.go index 5def0ec..c0a86a5 100644 --- a/notecard/scan.go +++ b/notecard/scan.go @@ -400,6 +400,14 @@ func loadRequests(filename string) (requests []map[string]interface{}, err error if err != nil { return } + + // First try to parse as a valid JSON array + err = note.JSONUnmarshal(contents, &requests) + if err == nil { + return + } + + // Then try to parse as a newline-delimited list of JSON objects jrecs := bytes.Split(contents, []byte("\n")) for _, line := range jrecs { line = bytes.TrimSpace(line)