File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -716,6 +716,9 @@ func (e *extractor) reportDecl(x *ast.GenDecl) (a []cueast.Decl) {
716
716
var exprs []cueast.Expr
717
717
var named []cueast.Decl
718
718
for _ , v := range enums {
719
+ if v == "_" {
720
+ continue
721
+ }
719
722
label := cueast .NewString (v )
720
723
cueast .SetRelPos (label , cuetoken .Blank )
721
724
Original file line number Diff line number Diff line change
1
+ # Issue #1183
2
+
3
+ # Run get go
4
+ exec cue get go --local .
5
+ cmp a_go_gen.cue a_go_gen.cue.golden
6
+
7
+ -- a.go --
8
+ package a
9
+
10
+ type C int
11
+
12
+ // define some typed constants
13
+ const (
14
+ A C = iota
15
+ b
16
+ _
17
+ c
18
+ )
19
+
20
+ // define some untyped constants
21
+ const (
22
+ D = iota
23
+ e
24
+ _
25
+ f
26
+ )
27
+ -- go.mod --
28
+ module example.com/a
29
+
30
+ go 1.16
31
+ -- a_go_gen.cue.golden --
32
+ // Code generated by cue get go. DO NOT EDIT.
33
+
34
+ //cue:generate cue get go example.com/a
35
+
36
+ package a
37
+
38
+ #C: int // #enumC
39
+
40
+ #enumC:
41
+ #A |
42
+ _#b |
43
+ _#c
44
+
45
+ #values_C: {
46
+ A: #A
47
+ b: _#b
48
+ c: _#c
49
+ }
50
+
51
+ #A: #C & 0
52
+ _#b: #C & 1
53
+ _#c: #C & 3
54
+
55
+ #D: 0
56
+ _#e: 1
57
+ _#f: 3
You can’t perform that action at this time.
0 commit comments