This PR fixes a bug where boilerplate wasn’t able to pass lists and maps properly to dependencies. I updated the automated test to catch this bug. Before the fix, the test would exit with the error “Value '[Foo Bar Baz]' is not a valid value for variable 'EnumNames' with type 'list’.” After this fix, it works correctly.
The cause is as follows. When boilerplate gets a variable from YAML, a list is represented as an []interface{} and a map as map[interface{}]interface{}. boilerplate looks for these types and converts them to []string and map[string]string. However, when we passed this converted value to a dependency, we were still only looking for the more generic versions []interface{} and map[interface{}]interface{}.
This PR fixes a bug where boilerplate wasn’t able to pass lists and maps properly to dependencies. I updated the automated test to catch this bug. Before the fix, the test would exit with the error “Value '[Foo Bar Baz]' is not a valid value for variable 'EnumNames' with type 'list’.” After this fix, it works correctly.
The cause is as follows. When boilerplate gets a variable from YAML, a list is represented as an
[]interface{}
and a map asmap[interface{}]interface{}
. boilerplate looks for these types and converts them to[]string
andmap[string]string
. However, when we passed this converted value to a dependency, we were still only looking for the more generic versions[]interface{}
andmap[interface{}]interface{}
.