code: func WriteToFile(config clientcmdapi.Config, filename string) error {
  	content, err := Write(config)
  	if err != nil {
  		return err
  	}
  	dir := filepath.Dir(filename)
  	if _, err := os.Stat(dir); os.IsNotExist(err) {
  		if err = os.MkdirAll(dir, 0755); err != nil {
  			return err
  		}
  	}
  
  	if err := ioutil.WriteFile(filename, content, 0600); err != nil {
  		return err
  	}
  	return nil
  }
docs: // WriteToFile serializes the config to yaml and writes it out to a file.  If not present, it creates the file with the mode 0600.  If it is present
  // it stomps the contents