code: func writeControllerFiles(tables []*Table, cPath string, pkgPath string) {
  	w := colors.NewColorWriter(os.Stdout)
  
  	for _, tb := range tables {
  		if tb.Pk == "" {
  			continue
  		}
  		filename := getFileName(tb.Name)
  		fpath := path.Join(cPath, filename+".go")
  		var f *os.File
  		var err error
  		if utils.IsExist(fpath) {
  			beeLogger.Log.Warnf("'%s' already exists. Do you want to overwrite it? [Yes|No] ", fpath)
  			if utils.AskForConfirmation() {
  				f, err = os.OpenFile(fpath, os.O_RDWR|os.O_TRUNC, 0666)
  				if err != nil {
  					beeLogger.Log.Warnf("%s", err)
  					continue
  				}
  			} else {
  				beeLogger.Log.Warnf("Skipped create file '%s'", fpath)
  				continue
  			}
  		} else {
  			f, err = os.OpenFile(fpath, os.O_CREATE|os.O_RDWR, 0666)
  			if err != nil {
  				beeLogger.Log.Warnf("%s", err)
  				continue
  			}
  		}
  		fileStr := strings.Replace(CtrlTPL, "{{ctrlName}}", utils.CamelCase(tb.Name), -1)
  		fileStr = strings.Replace(fileStr, "{{pkgPath}}", pkgPath, -1)
  		if _, err := f.WriteString(fileStr); err != nil {
  			beeLogger.Log.Fatalf("Could not write controller file to '%s': %s", fpath, err)
  		}
  		utils.CloseFile(f)
  		fmt.Fprintf(w, "\t%s%screate%s\t %s%s\n", "\x1b[32m", "\x1b[1m", "\x1b[21m", fpath, "\x1b[0m")
  		utils.FormatSourceCode(fpath)
  	}
  }
docs: // writeControllerFiles generates controller files