Reapply "blueprintload: enable strict checking for toml"

This reverts commit f25b5e325e.
This commit is contained in:
Michael Vogt 2025-04-08 11:44:04 +02:00 committed by Simon de Vlieger
parent 7fbae14142
commit a2f71ad44c
2 changed files with 19 additions and 4 deletions

View file

@ -21,11 +21,13 @@ func decodeToml(r io.Reader, what string) (*externalBlueprint.Blueprint, error)
dec := toml.NewDecoder(r)
var conf externalBlueprint.Blueprint
_, err := dec.Decode(&conf)
metadata, err := dec.Decode(&conf)
if err != nil {
return nil, fmt.Errorf("cannot decode %q: %w", what, err)
}
if len(metadata.Undecoded()) > 0 {
return nil, fmt.Errorf("cannot decode %q: unknown keys found: %v", what, metadata.Undecoded())
}
return &conf, nil
}