code: func (configFile *ConfigFile) SaveToWriter(writer io.Writer) error {
  	// Encode sensitive data into a new/temp struct
  	tmpAuthConfigs := make(map[string]types.AuthConfig, len(configFile.AuthConfigs))
  	for k, authConfig := range configFile.AuthConfigs {
  		authCopy := authConfig
  		// encode and save the authstring, while blanking out the original fields
  		authCopy.Auth = encodeAuth(&authCopy)
  		authCopy.Username = ""
  		authCopy.Password = ""
  		authCopy.ServerAddress = ""
  		tmpAuthConfigs[k] = authCopy
  	}
  
  	saveAuthConfigs := configFile.AuthConfigs
  	configFile.AuthConfigs = tmpAuthConfigs
  	defer func() { configFile.AuthConfigs = saveAuthConfigs }()
  
  	data, err := json.MarshalIndent(configFile, "", "\t")
  	if err != nil {
  		return err
  	}
  	_, err = writer.Write(data)
  	return err
  }
docs: // SaveToWriter encodes and writes out all the authorization information to
  // the given writer