1
0
Fork 0
mirror of https://github.com/Luzifer/streamdeck.git synced 2024-10-18 05:04:18 +00:00

[#4] Use strict config parsing

in order to detect and not silently eat configuration errors during start-up

fixes #4

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-01-01 02:21:07 +01:00
parent 7cf0022f5b
commit 957d0f36a6
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -63,8 +63,13 @@ func loadConfig() error {
}
defer userConfFile.Close()
tempConf := newConfig()
if err = yaml.NewDecoder(userConfFile).Decode(&tempConf); err != nil {
var (
decoder = yaml.NewDecoder(userConfFile)
tempConf = newConfig()
)
decoder.SetStrict(true)
if err = decoder.Decode(&tempConf); err != nil {
return errors.Wrap(err, "Unable to parse config")
}