Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1129b8c authored by Cole Faust's avatar Cole Faust
Browse files

Disallow unknown fields in soong variables file

To catch issues earlier, like when renaming a field.

Test: Presubmits
Change-Id: Ie04507b54cc8de3efd27ee75ff32a85ea21b5750
parent d5e16ac5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -370,6 +370,7 @@ func loadFromConfigFile(configurable *ProductVariables, filename string) error {
	} else {
		// Make a decoder for it
		jsonDecoder := json.NewDecoder(configFileReader)
		jsonDecoder.DisallowUnknownFields()
		err = jsonDecoder.Decode(configurable)
		if err != nil {
			return fmt.Errorf("config file: %s did not parse correctly: %s", filename, err.Error())