cmd/cue: do not panic on empty jsonl inputs
buildPlan.instances always returned an iterator with at least
one instance, and in the case of an empty jsonl file,
this would result in iterating over a single nil instance.
This would cause the following logic, like exporting, to panic.
An empty jsonl input means zero files, and is allowed by the spec.
Moreover, zero bytes is not valid input, unlike YAML or TOML,
which produce null and {} respectively.
For these reasons, treat empty jsonl inputs as a stream of zero values.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ie0a62bb59d347011de5aa47f5ee6d175824451a3
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199451
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>