I've tried to use the regexp package to replace text :
{% macro products_list(products) %}
{% for product in products %}
productsList
{% endfor %}
{% endmacro %}
I could not replace "products" without replace other words like "products_list"; and Golang has not a function like re.ReplaceAllStringSubmatch to replace with submatch (there's just FindAllStringSubmatch). I've used re.ReplaceAllString to replace "products" with .
{% macro ._list(.) %}
{% for product in . %}
.List
{% endfor %}
{% endmacro %}
But I need this result:
{% macro products_list (.) %}
{% for product in . %}
productsList
{% endfor %}
{% endmacro %}