config updated to improve setting values, writing changes and test coverage

This commit is contained in:
bwilliams committed 2026-10-13 13:19:01 +01:00
1 parent 8f0e72821f
commit 169c6c6b64
8 files changed
+453 -59

No files matched your search

+4 -2
View File
@@ -116,10 +116,12 @@ Nothing in `section.go` needs changing.
- `conf.Map()` (nested) and `conf.Flatten()` (dotted keys): the whole
configuration as a map.
- `conf.String()`, `conf.JSON()`, `conf.YAML()` and the matching `Print*`
methods: the configuration as text.
methods: the configuration as text, with keys sorted.
- `StoreValue(&conf, key, value)` / `PurgeValue(&conf, key)`: set or remove a
key in the config file Viper loaded. Used by `config set` and
`config set --unset`. `StoreValue` validates the value before writing it.
`config set --unset`. `StoreValue` validates the value before writing it,
and stores it as the field's own type. Only the file's own settings are
written back; defaults and environment variables never are.
- `LoadDefaultConfig`, `LoadToViper`, `LoadFromViper`: move values between
the struct defaults, Viper and a `JobSearchConfig`.