code: func parseDockerConfig(r io.Reader) (map[string]dockerConfig, error) {
  	buf := new(bytes.Buffer)
  	buf.ReadFrom(r)
  	byteData := buf.Bytes()
  
  	confsWrapper := struct {
  		Auths map[string]dockerConfig `json:"auths"`
  	}{}
  	if err := json.Unmarshal(byteData, &confsWrapper); err == nil {
  		if len(confsWrapper.Auths) > 0 {
  			return confsWrapper.Auths, nil
  		}
  	}
  
  	var confs map[string]dockerConfig
  	if err := json.Unmarshal(byteData, &confs); err != nil {
  		return nil, err
  	}
  	return confs, nil
  }
docs: // parseDockerConfig does the json unmarshalling of the data we read from the
  // file