cue icon indicating copy to clipboard operation
cue copied to clipboard

cmd/cue: get go does not recognize cue.Value

Open rogpeppe opened this issue 1 year ago • 0 comments

What version of CUE are you using (cue version)?

2d4a8952a5e7c8b8c4815ed89741c52e343cd17e

Does this issue reproduce with the latest stable release?

Yes (v0.10.0)

What did you do?

exec cue get go --local .
grep field1 x_go_gen.cue
grep field2 x_go_gen.cue
-- cue.mod/module.cue --
module: "example.test"
language: version: "v0.10.0"
-- go.mod --
module test
-- x.go --
package x

type X struct {
	Field1 int		`json:"field1"`
	Field2 cue.Value	`json:"field2"`
}

What did you expect to see?

A passing test. Both X.Field1 and X.Field2 are legitimate fields that can be encoded in CUE.

What did you see instead?

> exec cue get go --local .
> grep field1 x_go_gen.cue
> grep field2 x_go_gen.cue
[x_go_gen.cue]
// Code generated by cue get go. DO NOT EDIT.

//cue:generate cue get go test

package x

#X: {
	field1: int @go(Field1)
}

FAIL: /tmp/y.txtar:3: no match for `field2` found in x_go_gen.cue

rogpeppe avatar Oct 09 '24 16:10 rogpeppe