-
Notifications
You must be signed in to change notification settings - Fork 221
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
Add new relay/relay-monitor flags that can be used multiple times #351
Conversation
Codecov Report
@@ Coverage Diff @@
## main #351 +/- ##
==========================================
- Coverage 82.50% 81.91% -0.59%
==========================================
Files 5 5
Lines 680 680
==========================================
- Hits 561 557 -4
- Misses 91 94 +3
- Partials 28 29 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
i think that's nice, seeing people complain about configuring multiple relays comma-separated with a single flag, in particular in service config files. |
Reimplemented things a bit. The relays specified with the |
return err | ||
} | ||
if r.Contains(relay) { | ||
return errDuplicateEntry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about making this function idempotent, by not returning an error on duplicates?
this is really nice work! |
…ashbots#351) * Add new -relay/-relay-monitor flags that can be used multiple times * Add duplication detection for new flags * Fix linter issue * Rename instances of error * Directly add relay/monitors to new lists * Update readme
📝 Summary
-relay
and-relay-monitor
flags that can be specified multiple times.-relays
and-relay-monitors
.Before:
After:
Opening as a draft to get initial thoughts. There are still a few more things I want to do too.
Depends on #348 to work properly.
⛱ Motivation and Context
This is another thing that's been kind of bothering me. With the increasing number of relays, adding new relays is easy, but it's really hard to read/modify later; it's a long line of comma-separated relays.
I really do not want to break backwards compatibility. Most people won't want to change their flags to update. This compromise allows those that want to clean up their command to do it this way.
✅ I have run these commands
make lint
make test-race
go mod tidy