You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cue version
cue version v0.13.0-0.dev.0.20250217140725-3545df15d578
go version go1.23.5
-buildmode exe
-compiler gc
CGO_ENABLED 1
GOARCH amd64
GOOS linux
GOAMD64 v1
cue.lang.version v0.13.0
Does this issue reproduce with the latest stable release?
A passing test, indicating a friendlier error message that told me what I'd done to trigger the error.
What did you see instead?
> ! exec cue exp gengotypes file.cue
[stderr]
-- $WORK/cue_types_gen.go --
1: // Code generated by "cue exp gengotypes"; DO NOT EDIT.
2:
3: package
4:
5: type X struct {
6: Y int64 `json:"y"`
7:
8: Z string `json:"z"`
9:
10: }
11:
12:
--
5:1: expected 'IDENT', found 'type'
[exit status 1]
> ! stderr 'expected ''IDENT'', found ''type'''
FAIL: cue.exp.gengotypes.packagelessFilesErrorIsUnhelpful.txtar:2: unexpected match for `expected 'IDENT', found 'type'` found in stderr: expected 'IDENT', found 'type'
The text was updated successfully, but these errors were encountered:
jpluscplusm
changed the title
cmd/cue: unhelpful error message when exp-gengotypes fails to process a packageless CUE file
cmd/cue: exp gengotypes emits unhelpful error given a packageless CUE file
Feb 17, 2025
My thinking is to make this a nicer error, but still fail, because currently the CUE package name is crucial to know what filename to output to - and also what to name the resulting Go package.
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes,
v0.12.0
.What did you do?
What did you expect to see?
A passing test, indicating a friendlier error message that told me what I'd done to trigger the error.
What did you see instead?
The text was updated successfully, but these errors were encountered: