4 ms·
The json parsing library that parses the config file allows either syntax. That was intentional since we get in the habit as go programmers of ending lines in s
by ejcx 3y ago
The json parsing library that parses the config file allows either syntax. That was intentional since we get in the habit as go programmers of ending lines in structs/maps with commas, it's just for convenience.
- fl0ki 3y agoSerious question though, why use "JSON" at all then? You can just admit it's JWCC, which is fine, at least that's a distinct term -- but even that's not a spec, it's just a blog post that very few people even know about. Even that same blog post endorses using TOML, the spec generally preferred for things that may need to be human-edited. It meets humans half-way a lot better than even JWCC, which is the kind of practicality I think even Grug would prefer. https://nigeltao.github.io/blog/2021/json-with-commas-comments.html#why-not-toml-instead https://nigeltao.github.io/blog/2021/json-with-commas-commen... And while we're at it: https://www.arp242.net/json-config.html https://www.arp242.net/json-config.html https://dzone.com/articles/why-json-isnt-a-good-configuration-language https://dzone.com/articles/why-json-isnt-a-good-configuratio... https://revelry.co/insights/development/json-configuration-file-format/ https://revelry.co/insights/development/json-configuration-f...