code: func genConfigFiles(dstFolder string, cfg *newConfig, skipNonProd bool, force bool) error {
  	// Get base path containing templates folder and source files
  	p, _ := build.Default.Import(basePackage, "", build.FindOnly)
  	if p == nil || len(p.Dir) == 0 {
  		return errors.New("cannot locate base path containing templates folder")
  	}
  
  	configFiles := map[string]string{
  		filepath.Join(p.Dir, "templates", "config.toml.tmpl"): "config.toml",
  	}
  
  	if !skipNonProd {
  		configFiles[filepath.Join(p.Dir, "templates", "watch.toml.tmpl")] = "watch.toml"
  	}
  
  	for src, fname := range configFiles {
  		dst := filepath.Join(dstFolder, fname)
  
  		var perm os.FileMode
  		f, err := os.Stat(dst)
  		if err == nil {
  			// if force set and file exists delete file for recreation
  			if force {
  				perm = f.Mode()
  				if err := os.Remove(dst); err != nil {
  					return err
  				}
  			} else { // if force not set and file exists then continue to next file
  				continue
  			}
  		} else { // if file doesnt exist default to 0644 perms
  			perm = 0644
  		}
  
  		srcContents, err := ioutil.ReadFile(src)
  		if err != nil {
  			return err
  		}
  
  		t, err := template.New("").Funcs(templateFuncs).Parse(string(srcContents))
  		if err != nil {
  			return err
  		}
  
  		fileContents := &bytes.Buffer{}
  		err = t.Execute(fileContents, cfg)
  
  		if err := ioutil.WriteFile(dst, fileContents.Bytes(), perm); err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // genConfigFiles will generate fresh config files into dstFolder.
  // If skipNonProd is set to true it will skip config files that are not
  // required in production (such as watch.toml)