Skip to content

Introduce Global Constants #238

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

Closed
danehans opened this issue Jan 28, 2025 · 2 comments · Fixed by #273
Closed

Introduce Global Constants #238

danehans opened this issue Jan 28, 2025 · 2 comments · Fixed by #273
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

Comments

@danehans
Copy link
Contributor

Some values are being repeated throughout the codebase. Take the EPP gRPC listening port for example:

$ grep -ri 9002 pkg/
pkg/ext-proc/test/benchmark/benchmark.go:	svrAddr       = flag.String("server_address", "localhost:9002", "Address of the ext proc server")
pkg/ext-proc/test/benchmark/benchmark.go:	port = 9002
pkg/ext-proc/test/hermetic_test.go:	port = 9002
pkg/ext-proc/main.go:		9002,

We should audit CLI flag usage and create public constants for values that are used repeatedly in the codebase.

@danehans danehans added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jan 29, 2025
@adarshagrawal38
Copy link
Contributor

/assign

@adarshagrawal38
Copy link
Contributor

adarshagrawal38 commented Jan 31, 2025

Hi @danehans
I am thinking of using DefaultGrpcPort constant defined in pkg/ext-proc/server/runserver.go in benchmark.go to remove repetition of 9002.

And how do I look for other repeated values?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants