// Code generated by gocode.Generate; DO NOT EDIT.

package pkg2

import (
	"fmt"

	"cuelang.org/go/cue"
	"cuelang.org/go/encoding/gocode/gocodec"
	_ "cuelang.org/go/pkg"
)

var cuegenvalImportMe = cuegenMake("ImportMe", &ImportMe{})

// Validate validates x.
func (x *ImportMe) Validate() error {
	return cuegenCodec.Validate(cuegenvalImportMe, x)
}

var cuegenvalPickMe = cuegenMake("PickMe", nil)

// Validate validates x.
func (x PickMe) Validate() error {
	return cuegenCodec.Validate(cuegenvalPickMe, x)
}

var cuegenCodec, cuegenInstance_, cuegenValue = func() (*gocodec.Codec, *cue.Instance, cue.Value) {
	var r *cue.Runtime
	r = &cue.Runtime{}
	instances, err := r.Unmarshal(cuegenInstanceData)
	if err != nil {
		panic(err)
	}
	if len(instances) != 1 {
		panic("expected encoding of exactly one instance")
	}
	return gocodec.New(r, nil), instances[0], instances[0].Value()
}()

// Deprecated: cue.Instance is deprecated. Use cuegenValue instead.
var cuegenInstance = cuegenInstance_

// cuegenMake is called in the init phase to initialize CUE values for
// validation functions.
func cuegenMake(name string, x interface{}) cue.Value {
	f, err := cuegenValue.FieldByName(name, true)
	if err != nil {
		panic(fmt.Errorf("could not find type %q in instance", name))
	}
	v := f.Value
	if x != nil {
		w, err := cuegenCodec.ExtractType(x)
		if err != nil {
			panic(err)
		}
		v = v.Unify(w)
	}
	return v
}

// Data size: 278 bytes.
var 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")
