code: func allowV1Fallback(err error) error {
  	switch v := err.(type) {
  	case errcode.Errors:
  		if len(v) != 0 {
  			if v0, ok := v[0].(errcode.Error); ok && shouldV2Fallback(v0) {
  				return fallbackError{
  					err:         err,
  					confirmedV2: false,
  					transportOK: true,
  				}
  			}
  		}
  	case errcode.Error:
  		if shouldV2Fallback(v) {
  			return fallbackError{
  				err:         err,
  				confirmedV2: false,
  				transportOK: true,
  			}
  		}
  	case *url.Error:
  		if v.Err == auth.ErrNoBasicAuthCredentials {
  			return fallbackError{err: err, confirmedV2: false}
  		}
  	}
  
  	return err
  }
docs: // allowV1Fallback checks if the error is a possible reason to fallback to v1
  // (even if confirmedV2 has been set already), and if so, wraps the error in
  // a fallbackError with confirmedV2 set to false. Otherwise, it returns the
  // error unmodified.