cmd/cue/cmd: include unexported constants for get go
Mimic unexported status.
Omit `_`, still.
Change-Id: Ib89f082fc0022d0186ffaf654eaec353bdd95013
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6601
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/cmd/cue/cmd/get_go.go b/cmd/cue/cmd/get_go.go
index 759b154..a84c83f 100644
--- a/cmd/cue/cmd/get_go.go
+++ b/cmd/cue/cmd/get_go.go
@@ -681,7 +681,7 @@
}
for i, name := range v.Names {
- if !ast.IsExported(name.Name) {
+ if name.Name == "_" {
continue
}
f := e.def(v.Doc, name.Name, nil, k == 0)
diff --git a/cmd/cue/cmd/testdata/code/go/pkg1/file1.go b/cmd/cue/cmd/testdata/code/go/pkg1/file1.go
index 1aa7be5..a1a183f 100644
--- a/cmd/cue/cmd/testdata/code/go/pkg1/file1.go
+++ b/cmd/cue/cmd/testdata/code/go/pkg1/file1.go
@@ -67,6 +67,17 @@
Unsupported map[int]string
}
+type Identifier string
+
+const (
+ internalIdentifier Identifier = "internal"
+)
+
+const _ = true
+
+// appease linter
+var _ = internalIdentifier
+
// Level gives an indication of the extent of stuff.
type Level int
diff --git a/cmd/cue/cmd/testdata/pkg/cuelang.org/go/cmd/cue/cmd/testdata/code/go/pkg1/file1_go_gen.cue b/cmd/cue/cmd/testdata/pkg/cuelang.org/go/cmd/cue/cmd/testdata/code/go/pkg1/file1_go_gen.cue
index 5164026..a2f483c 100644
--- a/cmd/cue/cmd/testdata/pkg/cuelang.org/go/cmd/cue/cmd/testdata/code/go/pkg1/file1_go_gen.cue
+++ b/cmd/cue/cmd/testdata/pkg/cuelang.org/go/cmd/cue/cmd/testdata/code/go/pkg1/file1_go_gen.cue
@@ -47,6 +47,13 @@
} @go(,struct{CustomJSON})
}
+#Identifier: string // #enumIdentifier
+
+#enumIdentifier:
+ _#internalIdentifier
+
+_#internalIdentifier: #Identifier & "internal"
+
// Level gives an indication of the extent of stuff.
#Level: int // #enumLevel
diff --git a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/api/core/v1/annotation_key_constants_go_gen.cue b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/api/core/v1/annotation_key_constants_go_gen.cue
index 83bf898..889e56f 100644
--- a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/api/core/v1/annotation_key_constants_go_gen.cue
+++ b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/api/core/v1/annotation_key_constants_go_gen.cue
@@ -48,6 +48,7 @@
// annotation key prefix used to identify non-convertible json paths.
#NonConvertibleAnnotationPrefix: "non-convertible.kubernetes.io"
+_#kubectlPrefix: "kubectl.kubernetes.io/"
// LastAppliedConfigAnnotation is the annotation used to store the previous
// configuration of a resource for use in a three way diff by UpdateApplyAnnotation.
diff --git a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/api/resource/math_go_gen.cue b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/api/resource/math_go_gen.cue
new file mode 100644
index 0000000..711f209
--- /dev/null
+++ b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/api/resource/math_go_gen.cue
@@ -0,0 +1,13 @@
+// Code generated by cue get go. DO NOT EDIT.
+
+//cue:generate cue get go k8s.io/apimachinery/pkg/api/resource
+
+package resource
+
+// maxInt64Factors is the highest value that will be checked when removing factors of 10 from an int64.
+// It is also the maximum decimal digits that can be represented with an int64.
+_#maxInt64Factors: 18
+
+_#mostNegative: -9223372036854775808
+
+_#mostPositive: 9223372036854775807
diff --git a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/api/resource/quantity_go_gen.cue b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/api/resource/quantity_go_gen.cue
index 6eb9414..704348f 100644
--- a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/api/resource/quantity_go_gen.cue
+++ b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/api/resource/quantity_go_gen.cue
@@ -78,3 +78,9 @@
#DecimalExponent: #Format & "DecimalExponent"
#BinarySI: #Format & "BinarySI"
#DecimalSI: #Format & "DecimalSI"
+
+// splitREString is used to separate a number from its suffix; as such,
+// this is overly permissive, but that's OK-- it will be checked later.
+_#splitREString: "^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$"
+
+_#int64QuantityExpectedBytes: 18
diff --git a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/apis/meta/v1/types_go_gen.cue b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/apis/meta/v1/types_go_gen.cue
index 997841d..a221e94 100644
--- a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/apis/meta/v1/types_go_gen.cue
+++ b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/apis/meta/v1/types_go_gen.cue
@@ -858,7 +858,8 @@
#CauseTypeFieldValueInvalid |
#CauseTypeFieldValueNotSupported |
#CauseTypeUnexpectedServerResponse |
- #CauseTypeFieldManagerConflict
+ #CauseTypeFieldManagerConflict |
+ #CauseTypeResourceVersionTooLarge
// CauseTypeFieldValueNotFound is used to report failure to find a requested value
// (e.g. looking up an ID).
@@ -889,6 +890,10 @@
// It should only be returned for a request using server-side apply.
#CauseTypeFieldManagerConflict: #CauseType & "FieldManagerConflict"
+// CauseTypeResourceVersionTooLarge is used to report that the requested resource version
+// is newer than the data observed by the API server, so the request cannot be served.
+#CauseTypeResourceVersionTooLarge: #CauseType & "ResourceVersionTooLarge"
+
// List holds a list of objects, which may not be known by the server.
#List: {
#TypeMeta
diff --git a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/runtime/codec_go_gen.cue b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/runtime/codec_go_gen.cue
index 39bbb1f..c1b7075 100644
--- a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/runtime/codec_go_gen.cue
+++ b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/runtime/codec_go_gen.cue
@@ -9,7 +9,12 @@
Decoder: #Decoder
}
+_#noopEncoderIdentifier: #Identifier & "noop"
+
// NoopDecoder converts an Encoder to a Serializer or Codec for code that expects them but only uses encoding.
#NoopDecoder: {
Encoder: #Encoder
}
+
+_#internalGroupVersionerIdentifier: "internal"
+_#disabledGroupVersionerIdentifier: "disabled"
diff --git a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/watch/mux_go_gen.cue b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/watch/mux_go_gen.cue
index 46d1c89..5c52678 100644
--- a/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/watch/mux_go_gen.cue
+++ b/doc/tutorial/kubernetes/quick/cue.mod/gen/k8s.io/apimachinery/pkg/watch/mux_go_gen.cue
@@ -14,3 +14,7 @@
#WaitIfChannelFull: #FullChannelBehavior & 0
#DropIfChannelFull: #FullChannelBehavior & 1
+
+_#incomingQueueLength: 25
+
+_#internalRunFunctionMarker: "internal-do-function"