See the Liquid documentation https://help.shopify.com/themes/liquid/tags/iteration-tags#for (search for reversed), and the Shopify/liquid test:
assert_template_result('321', '{%for item in array reversed %}{{item}}{%endfor%}', assigns)
To reproduce:
template, err := liquid.ParseString("{% for item in array reversed %}{{item}}{% endfor%}", nil)
if err != nil {
fmt.Println("err:", err)
} else {
writer := new(bytes.Buffer)
template.Render(writer, map[string]interface{}{
"array": []int{1, 2, 3},
})
fmt.Println(writer)
}
Expected:
321
Actual (once #13 is fixed):
err: "reversed" is an unknown attribute in for tag ("{% for item in array reverse %}" - line 1)
See the Liquid documentation https://help.shopify.com/themes/liquid/tags/iteration-tags#for (search for
reversed), and the Shopify/liquid test:To reproduce:
Expected:
321Actual (once #13 is fixed):
err: "reversed" is an unknown attribute in for tag ("{% for item in array reverse %}" - line 1)