code: func ConvertIdentifierToUsername(identifier string, valMgr *validation.Manager) (string, error) {
  	email, err := valMgr.GetByEmailAddress(identifier)
  	if err == nil {
  		return email.Username, err
  	} else if valMgr.IsErrNotFound(err) {
  		phone, err := valMgr.GetByPhoneNumber(identifier)
  		if err == nil || db.IsNotFound(err) {
  			return phone.Username, nil
  		}
  		return identifier, err
  
  	}
  	return identifier, err
  }
docs: // ConvertIdentifierToUsername converts an identifier to a username.