cmd/cue: more resilient mod init version
Before now, if there wasn't an available version,
`cue mod init` would create a module file with
no language version. However as the language version
field is now mandatory, this isn't a good approach.
Instead, we sanity check that the version is at least
the minimum supported version and use the fallback
version otherwise.
Technically we could compare with the fallback version
instead, because the actual version should always be at
least that, but tests often use a fixed version that's
not kept up to date, so this approach seems a bit better.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I732c94467285a2c5d502b67c4ba0616e6bb1a53b
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193331
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>