gruntwork-io / boilerplate

A tool for generating files and folders ("boilerplate") from a set of templates
https://www.gruntwork.io
Mozilla Public License 2.0
160 stars 12 forks source link

Fix bug with passing lists and maps to dependencies #22

Closed brikis98 closed 7 years ago

brikis98 commented 7 years ago

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{}.

brikis98 commented 7 years ago

@josh-padnick Since you're traveling now, I'm going to merge this. Feedback welcome.

josh-padnick commented 7 years ago

7 days later, LGTM!