Michael Crenshaw
Michael Crenshaw
I think my earlier suggestion was over-complicated. What if we detected old-style templates and simply upgrade them? This regex should work for path segments: ```regex {{\s*path\[(\d+)\]\s*}} ``` You can insert...
The git files generator introduces some more complicated cases. I forget how flexible the old flatten logic was, but I believe a regex-based upgrade is still possible. ```regex {{\s*(([a-zA-Z\d]+?(\.[a-zA-Z\d]+))+)\s*}} ```...
I still think option 4 is viable. The [functions](https://github.com/golang/go/blob/9ce28b518d9a792d2e3e741bcb38fa046891906e/src/text/template/funcs.go#L42-L62) shouldn't be a problem, because as far as I can tell, they all require a space and then at least one...
Extremely well researched, thanks! I agree with your hesitations about the regex implementation. Option 2 seems very reasonable to me. > Concerning solution 2,based on the choice it will imply...
This is looking awesome! Do we have tests for handling quotation marks in parameter values? I know the fasttemplate implementation had logic to handle escaping quotes (and other JSON control...
@speedfl I'm more concerned about what happens when values contain quotes, since we're templating over a JSON blob. Consider this case: ```go template.Must(template.New("").Parse(`{"key": "{{.value}}"}`)) ``` If `.value` == `"`, then...
@speedfl I'm not sure pre-processing the params will be sufficient. The output of the go expression can still be un-escaped. For example: ``` { name: "quote", fieldVal: `{{ slice .quote...
> Going through all fields would be more secure I think Honestly this would very much be my preference. Just recurse over the template and run substitution for each string...
That's awesome! Mind running `make lint-local` to clear that check (I'm thinking the other integration test failure is just a flaky test).
@speedfl apologies for the slow review. Taking a look today. This would be awesome to have in 2.5. :-)