Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional Options Pattern for initializing tcping #280

Open
Ilhan-Personal opened this issue Jan 1, 2025 · 0 comments
Open

Functional Options Pattern for initializing tcping #280

Ilhan-Personal opened this issue Jan 1, 2025 · 0 comments
Milestone

Comments

@Ilhan-Personal
Copy link
Contributor

Ilhan-Personal commented Jan 1, 2025

Currently, the initialization of tcping instances occurs through a method called processUserInput, which directly modifies the fields of a tcping struct based on command-line flags and other input parameters. This method has grown to become complex and handles multiple aspects of the setup, which impacts maintainability and testability.

We aim to refactor this initialization routine by implementing the Functional Options Pattern, in which the tcping initialization is broken down into a series of small functions, each with a single responsibility: configuring a specific aspect of the tcping instance.

https://golang.cafe/blog/golang-functional-options-pattern.html

@pouriyajamshidi pouriyajamshidi added this to the release_v3 milestone Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants