doc/ref: start testing CUE code blocks in the spec via `go test`
For now, this just enforces valid CUE syntax for the code blocks
annotated accordingly. We use https://github.com/yuin/goldmark,
which had been a dependency until recently as we had been using it
to detect GitHub usernames being pinged by commit messages.
We use a Go test as it will run as part of `go test ./...`,
and we can also leverage env vars like CUE_UPDATE=1 in the future.
We considered using a standalone main func invoked via `go generate`,
but that required a Go package file with a `//go:generate` directive
and we did not want to make doc/ref an importable Go package.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I1607b1edadb937937a7f04c67112d7c0bcda815d
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1232179
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>