Open rmrnc opened 1 month ago
It may just be an over-simple example, but why are you using index
when you could just refer to the item by .key
?
One other issue here is that the test.Ternary expects a boolean (or boolean-like string), so feeding it "value"
is indeed going to cause confusion.
The reason the second example works is that the if
keyword is much broader in scope - given a non-boolean value it'll consider any non-empty value to be true
. I suppose the documentation is somewhat misleading:
This is effectively a short-form of the following template:
the word "effectively" does a lot of heavy lifting there, as what I really meant was "this is similar in concept, but with subtle and very important differences" 🤦♂️
Perhaps simply removing that block would reduce confusion...
Hi Maybe it's just me, but somehow the semantic of
gomplate
'stest.Ternary
processing the result ofindex
eludes me.Especially, when compared to
Would you mind pointing out where I went wrong?
Thank you very much