func Generate(opts *Options, envs ...string) error {
	dirs := make([]string, len(envs)+1)

	dirs[0] = opts.Output

	for i, env := range envs {
		g, err := newGenerator(env, opts)
		if err != nil {
			return err
		}

		if err := g.generate(); err != nil {
			return err
		}

		if err := g.copy(); err != nil {
			return err
		}

		dirs[1+i] = g.output
	}

	if !opts.Dry && len(opts.Package) > 0 {
		return preparePackage(longestcommon.Prefix(dirs), opts.Package)
	}

	return nil
}
// Generate is the main entry point, called after parsing command line.
Generate is the main entry point, called after parsing command line.
// Generate is the main entry point called after parsing command line .
func Generate(opts *Options, envs ...string) error {
	dirs := make([]string, len(envs)+1)
	dirs[0] = opts.Output
	for i, env := range envs {
		g, err := newGenerator(env, opts)
		if err != nil {
			return err
		}
		if err := g.generate(); err != nil {
			return err
		}
		if err := g.copy(); err != nil {
			return err
		}
		dirs[1+i] = g.output
	}
	if !opts.Dry && len(opts.Package) > 0 {
		return preparePackage(longestcommon.Prefix(dirs), opts.Package)
	}
	return nil
}
func Generate ( opts * Options , envs ... string ) error { dirs := make ( [ ] string , len ( envs ) + 1 ) dirs [ 0 ] = opts . Output for i , env := range envs { g , err := newGenerator ( env , opts ) if err != nil { return err } if err := g . generate ( ) ; err != nil { return err } if err := g . copy ( ) ; err != nil { return err } dirs [ 1 + i ] = g . output } if ! opts . Dry && len ( opts . Package ) > 0 { return preparePackage ( longestcommon . Prefix ( dirs ) , opts . Package ) } return nil }
Generate is the main entry point, called after parsing command line.
Generate is the main entry point called after parsing command line .