Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do type checking after rendering variables #40

Merged
merged 3 commits into from Aug 20, 2017
Merged

Do type checking after rendering variables #40

merged 3 commits into from Aug 20, 2017

Conversation

brikis98
Copy link
Member

@brikis98 brikis98 commented Aug 20, 2017

In recent releases of boilerplate, I added support for using interpolations in variable values (e.g., default: "{{ .Foo }}"), but that had a bug in it where I was checking types before rendering a variable. So if you set a variable with type: bool to an interpolation such as "{{ eq .SomeValue 42}}", you would get an error that the value was of the wrong type.

It took a bit of refactoring (99% of the code changes are moving things into different packages to avoid circular dependencies), but the code should now check types after rendering, including coercing values to an expected type (e.g., coercing the string “true” to the bool value true) to make these sorts of interpolations work correctly.

@brikis98
Copy link
Member Author

Merging now. Feedback welcome!

@brikis98 brikis98 merged commit 1c72eb2 into master Aug 20, 2017
@brikis98 brikis98 deleted the type-check branch August 20, 2017 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant