Skip to content

refactor: extract duplicate parameter encoding logic#7

Merged
RoseSecurity merged 1 commit intomainfrom
extract-duplicate-parameter-logic
Mar 2, 2026
Merged

refactor: extract duplicate parameter encoding logic#7
RoseSecurity merged 1 commit intomainfrom
extract-duplicate-parameter-logic

Conversation

@RoseSecurity
Copy link
Copy Markdown
Collaborator

What and Why

This pull request refactors parameter encoding logic for domain and alias management in the ForwardEmail client, improving code reusability and maintainability. The main changes involve extracting repeated code for encoding parameters into dedicated helper functions, and updating the relevant methods to use these helpers.

Refactoring and Code Reuse:

  • Introduced the encodeAliasParams helper function in forwardemail/aliases.go to centralize and simplify alias parameter encoding, replacing duplicated logic in both CreateAlias and UpdateAlias. [1] [2] [3]
  • Added the encodeDomainParams helper function in forwardemail/domains.go to handle domain parameter encoding, removing repeated code from CreateDomain and UpdateDomain. [1] [2] [3]

Extract encodeAliasParams and encodeDomainParams helper functions
to reduce code duplication in CreateAlias/UpdateAlias and
CreateDomain/UpdateDomain methods.
@RoseSecurity RoseSecurity merged commit be1c6c4 into main Mar 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant