Disallow unknown fields in soong variables file
To catch issues earlier, like when renaming a field. Test: Presubmits Change-Id: Ie04507b54cc8de3efd27ee75ff32a85ea21b5750
This commit is contained in:
@@ -370,6 +370,7 @@ func loadFromConfigFile(configurable *ProductVariables, filename string) error {
|
|||||||
} else {
|
} else {
|
||||||
// Make a decoder for it
|
// Make a decoder for it
|
||||||
jsonDecoder := json.NewDecoder(configFileReader)
|
jsonDecoder := json.NewDecoder(configFileReader)
|
||||||
|
jsonDecoder.DisallowUnknownFields()
|
||||||
err = jsonDecoder.Decode(configurable)
|
err = jsonDecoder.Decode(configurable)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("config file: %s did not parse correctly: %s", filename, err.Error())
|
return fmt.Errorf("config file: %s did not parse correctly: %s", filename, err.Error())
|
||||||
|
Reference in New Issue
Block a user