code: func Generate() (files []string, err error) {
  	var (
  		outDir, designPkg, appPkg, ver, res, pkg string
  		force, regen                             bool
  	)
  
  	set := flag.NewFlagSet("controller", flag.PanicOnError)
  	set.StringVar(&outDir, "out", "", "")
  	set.StringVar(&designPkg, "design", "", "")
  	set.StringVar(&appPkg, "app-pkg", "app", "")
  	set.StringVar(&pkg, "pkg", "main", "")
  	set.StringVar(&res, "res", "", "")
  	set.StringVar(&ver, "version", "", "")
  	set.BoolVar(&force, "force", false, "")
  	set.BoolVar(&regen, "regen", false, "")
  	set.Bool("notest", false, "")
  	set.Parse(os.Args[1:])
  
  	if err := codegen.CheckVersion(ver); err != nil {
  		return nil, err
  	}
  
  	g := &Generator{OutDir: outDir, DesignPkg: designPkg, AppPkg: appPkg, Force: force, Regen: regen, API: design.Design, Pkg: pkg, Resource: res}
  
  	return g.Generate()
  }
docs: // Generate is the generator entry point called by the meta generator.