Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions notecard/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading