How can I show elements with only even index in a view(using Beego framework)?

47 views Asked by At

So the problem is that I can not show even elements in my view file. I have the following code in my view file:


    {{range $i, $stream := .d}}
        {{if $i % 2 == 0}}
            {{$stream.Channel.Status}}
        {{end}}
    {{end}}

From the docs I've read that "You CANNOT use conditional expressions in if. Only boolean values are acceptable."

So how can I implement it?

Thanks in advance

0

There are 0 answers