1// Code generated by gocode.Generate; DO NOT EDIT.
2
3package pkg2
4
5import (
6 "fmt"
7
8 "cuelang.org/go/cue"
9 "cuelang.org/go/encoding/gocode/gocodec"
10 _ "cuelang.org/go/pkg"
11)
12
13var cuegenvalImportMe = cuegenMake("ImportMe", &ImportMe{})
14
15// Validate validates x.
16func (x *ImportMe) Validate() error {
17 return cuegenCodec.Validate(cuegenvalImportMe, x)
18}
19
20var cuegenvalPickMe = cuegenMake("PickMe", nil)
21
22// Validate validates x.
23func (x PickMe) Validate() error {
24 return cuegenCodec.Validate(cuegenvalPickMe, x)
25}
26
27var cuegenCodec, cuegenInstance_, cuegenValue = func() (*gocodec.Codec, *cue.Instance, cue.Value) {
28 var r *cue.Runtime
29 r = &cue.Runtime{}
30 instances, err := r.Unmarshal(cuegenInstanceData)
31 if err != nil {
32 panic(err)
33 }
34 if len(instances) != 1 {
35 panic("expected encoding of exactly one instance")
36 }
37 return gocodec.New(r, nil), instances[0], instances[0].Value()
38}()
39
40// Deprecated: cue.Instance is deprecated. Use cuegenValue instead.
41var cuegenInstance = cuegenInstance_
42
43// cuegenMake is called in the init phase to initialize CUE values for
44// validation functions.
45func cuegenMake(name string, x interface{}) cue.Value {
46 f, err := cuegenValue.FieldByName(name, true)
47 if err != nil {
48 panic(fmt.Errorf("could not find type %q in instance", name))
49 }
50 v := f.Value
51 if x != nil {
52 w, err := cuegenCodec.ExtractType(x)
53 if err != nil {
54 panic(err)
55 }
56 v = v.Unify(w)
57 }
58 return v
59}
60
61// Data size: 278 bytes.
62var cuegenInstanceData = []byte("\x01\x1f\x8b\b\x00\x00\x00\x00\x00\x00\xffD\x8e\xc1J31\x14\x85\xef\x99\xce\x0f\x7fC\x15|\x00a\x98U\xdd\xccTA\x17E\u012a\b.\x94\xe2V\\\\\xd3\x18C\u06e44\x19AD\xd4Z}\x1f\x9f0\x92Rqw\xf8\xee=\x87o#~f\xc8\xe2\x17!\xbe\x11\x1d\xbc\xb6\x80\x8e\xb1>\xb0\x95\xea\x8c\x03'\x8c\x16\xf2k\xe7\x022B>\xe4\xf0\x80\x0e\xe1\u07f9\x99(\x8f\xb8$\xa2\xed\xf8\x91\x01\x9b7\xb7\xb2Q\u057d\x99\xac\x9bKB\\\x10u\xe3{\v\xf8\xff\xc7\x17\x84\f\xf9\x15OU\x1a\xcaWP\x10Q\xfcN\x1e\x00j\u0668\t[]\xb9\xb9\xae\xb5\xab\x95\x95ndl\xca\u048dT\x1d\x94\x0f#\x0e\\\xcf\xc6z\xef\xf8\xb1\a`+\xc5\xfa\u05fc\x92\x8d\x02\xcfX\x8eY\xab\"\x9d\x840\u04d9\x9b\x87\xa2\xf4an\xac\xf6\xa5\x10\x17+r\xa9\xfa\u0173h\x0f\xfa\xc5\xe1n\xaf'\xda'\xfdb\xfdR\x9d:\x1b\xd8X?\xb0O\u0752\xefd\xb9#^\xc4\xd0\xc8q\xea\x1c\xed\v\xa2\x9f\x00\x00\x00\xff\xff\nc\x81w?\x01\x00\x00")