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
17 changes: 9 additions & 8 deletions cbor/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,15 @@ func generateAstJsonMap[T map[any]any | Map](v T) ([]byte, error) {
if err != nil {
return nil, err
}
// NOTE: Github CodeQL hates this due to "potentially unsafe quoting", but it
// won't happen in practice since both values injected are auto-generated
tmpJson := fmt.Sprintf(
`{"k":%s,"v":%s}`,
keyAstJson,
valAstJson,
)
tmpItems = append(tmpItems, tmpJson)
tmpJsonMap := map[string]json.RawMessage{
"k": keyAstJson,
"v": valAstJson,
}
tmpJson, err := json.Marshal(tmpJsonMap)
if err != nil {
return nil, err
}
tmpItems = append(tmpItems, string(tmpJson))
}
// We naively sort the rendered map items to give consistent ordering
sort.Strings(tmpItems)
Expand Down