Reapply "blueprintload: enable strict checking for toml"
This reverts commit f25b5e325e.
This commit is contained in:
parent
7fbae14142
commit
a2f71ad44c
2 changed files with 19 additions and 4 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue