Skip to content

Commit

Permalink
cmd/cue: speed up get_go_json_compat.txtar
Browse files Browse the repository at this point in the history
We only need to `cue get go` the decls package, and not the marshal
and unmarshal packages which we only use for `go run`.
This results in less work to load Go packages in `cue get go`,
speeding up the test on my laptop from 0.50s to 0.42s.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I207aea043edf8070a4a9e29308103d6a46654a09
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1198963
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
  • Loading branch information
mvdan committed Aug 7, 2024
1 parent 3260084 commit 20d3c9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/cue/cmd/testdata/script/get_go_json_compat.txtar
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Check that the CUE generated by 'cue get go' is actually compatible
# with encoding and decoding values via Go's encoding/json package.

exec cue get go --local ./...
exec cue get go --local ./decls
cmp decls/p_go_gen.cue decls/p_go_gen.cue.golden

# Marshal via Go's encoding/json and validate with the generated CUE schema.
Expand Down

0 comments on commit 20d3c9c

Please sign in to comment.