I know this is a quite old topic, but for whoever -like myself- falls in here trying to find binary comparison operators.
{{with $x := functionX "value1" "value2"}}{{if eq $x "some-result"}}true{{end}} {{end}} Maybe there weren't in 2013 but exists in 2019 https://golang.org/pkg/text/template/#hdr-Functions On Monday, 2 April 2012 19:44:51 UTC+1, DEXTER wrote: > > Hi > > How can I test if if a variable matches a value > ex: {{if $name == "id"}} {$name}} {{end}} > or > {{if $index == 2}} {$index}} {{end}} > > > Thanks > Dexter -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/76d96d12-84ff-436e-9435-b74ea2e84653%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.