Say why null stays JSON in the padded-JSON decision

This commit is contained in:
2026-10-08 12:27:01 +02:00
committed by Lillem4n
parent 357a2a276d
commit 88e9dd9fc9
+3 -3
View File
@@ -118,9 +118,9 @@ until item 129: it reads a path, and only the data is absent.
Padding is where the two readings disagree: a format string renders it, JSON drops it. A
template that parses as a JSON object, array, string or `null` is its JSON, so its padding
is dropped, as `encoding/json` drops it. A bare number or boolean gains nothing from the
JSON reading, so it is a format string, and `echo 42` prints its newline as `echo x` does
(goal 5.1).
is dropped, as `encoding/json` drops it. `null` stays JSON, since it is how a template
renders nothing. A bare number or boolean gains nothing from the JSON reading, so it is a
format string, and `echo 42` prints its newline as `echo x` does (goal 5.1).
## A JSON string stays a template even where its bare text renders alike