Michael Halim
Michael Halim

Reputation: 726

How to reverse for loop in golang-revel

i'm aware that you can do for loop in revel like this

{{range $index, $element := .foo }}

{{end}}

but is there any way to reverse a for loop so that it can iterating from behind in revel-template, i'm looking the equivalent of this code in golang-revel.

array = [ 'a','b','c' ]
for i in reversed(array):
    print(i)

what i've done so far is to reversed with order by in the backend and just iterating like normal, i would like to manipulate the data so that it can be reversed in a template

Upvotes: 1

Views: 172

Answers (0)

Related Questions