Re: [go-nuts] Testing on Go templates Range's index

2017-09-09 Thread Jan Mercl
On Sat, Sep 9, 2017 at 6:01 PM Tong Sun wrote: As documented , ne is a function, not an infix operator: https://play.golang.org/p/sJSzoNyrJz -- -j -- You received this message because you are subscribed to the

[go-nuts] Testing on Go templates Range's index

2017-09-09 Thread Tong Sun
Hi, If I have Go templates Range declared like this, {{range $i, $x := $.People}} How can I test its index value? I thought it should be `{{if $i ne 0}}` but it is not working for me: https://play.golang.org/p/NB10G1CjBr I've also tried `{{if $i ne "0"}}`, but that failed on me as well.