Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening a PR with a prototype as a means to discuss custom resolvers. Based off of this comment in #110, custom resolvers allow us to override default functionality when executing a template. This would open the possibility to:
This PR is purely a concept. It has no tests, and it exposes *Runtime directly from a template, which I do not like. So, word of warning, this PR is not ready and the aim here is to open a discussion with maintainers and owners regarding whether Resolver interfaces can be considered.
Stealing from my previous comment:
It adds a single interface -
Resolver:This allows us to define custom functions overriding default functionality in Resolve. You can always get the default resolver functionality within Runtime by calling
runtime.DefaultResolver().Usage:
I don't like how I have to expose the
Runtime()func within templates to get the default resolver at all to be honest, but yeah, like I said - it's a hacky POC to show that interfaces here might help.