#What config files is there for Go?
1 messages · Page 1 of 1 (latest)
json has types.
At least string, float and integer.
And if you build a conversion function, you can even save other datatypes and customs.
Which then on load you can create objects from.
Did that with python and with a sqlite db for my objects meeded as local save.
YAML, TOML, Pkl
What serious configuration format has types? If you need types you define them as models in your code
Probably as a struct in Go
yeah, just validate when you load the config
Oh is xml typed?
You can "type" it like you can type JSON
(e.g. all values are custom objects that have a type field and a value field)
Well XML has a schema format XSD that allows you to more or less assign types to elements and attributes
custom objects 🤢
If it’s meant to be updated my humans I prefer yaml but json would work too. You’d unmarshal either into a struct and itll return an error if the type is wrong
JSON is in the standard library though so you might prefer that
There is already some Toml in the project I might just continue with it