exec cue exp gengotypes --outfile cue_types.go ./pkg1
cmp cue_types.go cue_types.go.golden
! exists pkg1/cue_types_gen.go

# -o shorthand works too.
exec cue exp gengotypes -o cue_types2.go ./pkg1
cmp cue_types2.go cue_types.go.golden

# stdout works too.
exec cue exp gengotypes --outfile - ./pkg1
cmp stdout cue_types.go.golden

# Multiple packages are not allowed with --outfile.
! exec cue exp gengotypes --outfile out.go ./...
stderr 'only allows for one package'

-- cue.mod/module.cue --
module: "foo.test/root"
language: version: "v0.13.0"
-- pkg1/pkg1.cue --
package pkg1

#Foo: int
#Bar: string
-- pkg2/pkg2.cue --
package pkg2

#Baz: bool
-- cue_types.go.golden --
// Code generated by "cue exp gengotypes"; DO NOT EDIT.

package pkg1

type Foo int64

type Bar string
