Disallow unknown fields in soong variables file
To catch issues earlier, like when renaming a field.
Test: Presubmits
Change-Id: Ie04507b54cc8de3efd27ee75ff32a85ea21b5750
diff --git a/android/config.go b/android/config.go
index 5a6d40f..a1127ad 100644
--- a/android/config.go
+++ b/android/config.go
@@ -370,6 +370,7 @@
} 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())