Skip to content
Open
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
12 changes: 10 additions & 2 deletions query/outputnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,17 @@ func valToBytes(v types.Val) ([]byte, error) {
b := v.Value.(big.Float)
return b.MarshalText()
case types.UidID:
return []byte(fmt.Sprintf("\"%#x\"", v.Value)), nil
// Pre-sized: opening quote + "0x" + up to 16 hex digits + closing quote = 20.
uid, ok := v.Value.(uint64)
if !ok {
return []byte(fmt.Sprintf("\"%#x\"", v.Value)), nil
}
buf := make([]byte, 0, 20)
buf = append(buf, '"', '0', 'x')
buf = strconv.AppendUint(buf, uid, 16)
return append(buf, '"'), nil
case types.PasswordID:
return []byte(fmt.Sprintf("%q", v.Value.(string))), nil
return stringJsonMarshal(v.Value.(string)), nil
case types.VFloatID:
return json.Marshal(v.Value.([]float32))
default:
Expand Down
Loading