Inverting boolean not working
I’m new to the go language and after looking up i found the way to reverse a boolean but the result is not what I expected.
A variable’s scope extends to the “end” action of the control structure (“if”, “with”, or “range”) in which it is declared, or to the end of the template if there is no such control structure.
Example 1
{{ $var := "foo" }}
{{ range seq 4}}
{{ $var }}
{{ $var := "bar" }}
{{ end }}
foo foo foo foo
Example 2
{{ $var := "foo" }}
{{ range seq 4}}
{{ $var }}
{{ $var = "bar" }}
{{ end }}
Thanks for the quick reply!
The question now is: how can I acclompish a true, false, true, false?
I want to loop over all my components and if it’s true i will give in the dict of my partial a background color.
Expected result:
background color no background color
background color no background color