code: func (configFile *ConfigFile) Save() error {
  	if configFile.Filename == "" {
  		return errors.Errorf("Can't save config with empty filename")
  	}
  
  	dir := filepath.Dir(configFile.Filename)
  	if err := os.MkdirAll(dir, 0700); err != nil {
  		return err
  	}
  	temp, err := ioutil.TempFile(dir, filepath.Base(configFile.Filename))
  	if err != nil {
  		return err
  	}
  	err = configFile.SaveToWriter(temp)
  	temp.Close()
  	if err != nil {
  		os.Remove(temp.Name())
  		return err
  	}
  	return os.Rename(temp.Name(), configFile.Filename)
  }
docs: // Save encodes and writes out all the authorization information