--
You received this message because you are subscribed to the Google Groups "Jsonnet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jsonnet+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jsonnet/aa4c098a-f632-4166-8028-602ed937e75a%40googlegroups.com.
The branches need to return arrays, then you add them on to the rest of your array:
local var=true;
(if var then [{a:1},{d:3}] else [{a:2}])
+ [{c:2}]
On Fri, Aug 30, 2019 at 5:26 PM Ashish Abrol <ashis...@gmail.com> wrote:
Hi--I have recently started with jsonnet and having trouble working with if else construct.here is my sample program*******************************************************local var=true;[if var then {a:1},{d:3} else {a:2},{c:2}]******************************************************it results in errorSTATIC ERROR: one.jsonnet:4:26-29: Expected a comma before next array element.I am expecting it to generate the following outcome[{a:1},{d:3}},{c:2}]can someone help me get this result.thanksAshish
You received this message because you are subscribed to the Google Groups "Jsonnet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jso...@googlegroups.com.