# Issue 4108

exec cue get go --outfile outfile.cue ./x

# We can only compare the generated file to the expected golden file,
# as all imports are skipped and only the given package is generated.
cmp outfile.cue x_go_gen.cue.golden

! exists cue.mod/gen/ x/x_go_gen.cue y/y_go_gen.cue

! exec cue get go --outfile out.cue --local ./x
stderr 'mutually exclusive'

! exec cue get go --outfile out.cue ./x ./y
stderr 'only allows for one package'

-- go.mod --
module mod.test

go 1.21
-- cue.mod/module.cue --
module: "mod.test"
language: version: "v0.9.0"
-- x/x.go --
package x

import "mod.test/y"

type X = y.Y

-- x/x2.go --
package x

type X2 = X

-- y/y.go --
package y

import "mod.test/z"

type Y = z.Z

-- z/z.go --
package z

type Z int

-- x_go_gen.cue.golden --
// Code generated by cue get go. DO NOT EDIT.

//cue:generate cue get go mod.test/x

package x

import "mod.test/z"

#X: z.#Z

#X2: z.#Z
