// 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: 276 bytes.
var cuegenInstanceData = []byte("\x01\x1f\x8b\b\x00\x00\x00\x00\x00\x00\xffD\x8e\xc1J\x031\x14E\u07dd\x8e`C\x15\xfc\x00a\x98U\xdd\xccTA\x17EDQ\x04\x17Jq+.^\xd3\x18C\u06e44\x19AD\xd4Z\xfd\x1f\xbf0\x92Rqw9\xef\xdd\xcb\u064a_\x19\xb2\xf8M\x88\xefDGo-\xa0c\xac\x0fl\xa5\xba\xe0\xc0\t\xa3\x85\xfc\u05b9\x80\x8c\x90\x0f8<\xa2C\u06384\x13\xe5\x11\x97D\xb4\x1b?3`\xfb\xee^6\xaaz0\x93usI\x88\v\xa2n\xfch\x01\x9b\xff|A\u0210\xdf\xf0T\xa5\xa1|\x05\x05\x11\u015f\xe4\x01\xa0\x96\x8d\x9a\xb0\u0555\x9b\xebZ\xbbZY\xe9F\u01a6,\xddH\xd5A\xf90\xe2\xc0\xf5l\xac\x0fN\x9fz\x00vR\xac\xff\xcc+\xd9(\xf0\x8c\u5635*\xd2I\b3\x9d\xb9y(J\x1f\xe6\xc6j_\nq\xb5\"\u05ea_\xbc\x886\xf7\x8b\xe3\xfd^O\xb4\x87\xfdb\xfdR\x9d;\x1b\xd8X\x7ff\x9f\xbb%\x0fe\xb9'^\xc5\xc0\xc8q\xea\x9c\x1c\n\xa2\xdf\x00\x00\x00\xff\xffV\x13\xad0?\x01\x00\x00")
