Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
text/template: add a slice function to the predefined global functions #30153
I'm suggesting to add a function named
Would three-index slice expressions be supported, such as
Do you have any data or research to back the need/popularity of such a builtin function? We do have
I don't think the three-index form is a real use case for templates.
I didn't do any research before, just came up with my real use case. I use templates extensively, and many times find it missing for slicing/substring strings and slices.
Little searching in the web, led to find these few links:
Anyway, I don't mind leave it open and see what others think about this.
changed the title
text/template: add a slice function to the predefined global functions
Feb 10, 2019
@a8m more info can be found in https://github.com/golang/proposal/blob/master/README.md