// 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: 274 bytes.
var cuegenInstanceData = []byte("\x01\x1f\x8b\b\x00\x00\x00\x00\x00\x00\xffD\x8e\xc1J\x031\x10\x86\xe7\u07ee`C\x15|\x00a\xd9S\x05\u066d\x82\x1e\x8a\bU\x11<(\u016bx\x18\xd3\x18C\u06e44\u0643\x88\xa8\xb5\xfa8\xbeb$\xa5\xe2i\x86o\xe6\xff\xf9\xb6\xe2W\x86,~\x13\xe2;\xd1\xf1[\v\xe8\x18\xeb\x03[\xa9.8p\xc2h!\xbfu. #\xe4C\x0eO\xe8\x106.\xcdDy\xc4%\x11\xed\xc6\xcf\f\u063e\xbb\x97\x8d\xaa\x1e\xcdd\x9d\\\x12\u20a8\x1b?Z\xc0\xe6?_\x102\xe47<U\xa9(_AAD\xf1'y\x00\u0617\x8d\x9a\xb0\u0555\x9b\xebZ\xbbZY\xe9F\u01a6]\xba\x91\xaa\x83\xf2a\u0101\xeb\xd9X\x1f\x02\xd8I\xb3\xfe\u04eed\xa3\xc03\x96c\u05aaH'!\xcct\xe6\xe6\xa1(}\x98\x1b\xab})\xc4\u054a\\\xab~\xf1\"\u0683~qr\xd0\xeb\x89\xf6Y\xbfX\xbfT\xe7\xce\x066\xd6\x0f\xecs\xb7\xe4\aY\xee\x89W14r\x9c2\xa7G\x82\xe87\x00\x00\xff\xff\x8e\x9a[\x03<\x01\x00\x00")
