improve code quality#1064
Conversation
| case <-fw.err: | ||
| return nil, errors.New("error from underlying etcd watcher") | ||
| default: | ||
|
|
There was a problem hiding this comment.
This results in different behavior, does it not?
There was a problem hiding this comment.
It doesn't change the observed behavior (it'll still block until either one of the first two cases return something).
TBH I don't really understand why the for loop is necessary.
There was a problem hiding this comment.
Well if you have the default, you need the for, otherwise this is a one-and-done.
But it's still a terrible pattern, as it turns what could be a simple select into a hot loop?? Maybe an artifact from refactoring.
There was a problem hiding this comment.
Probably, yeah. @withshubh could you please remove the for loop as well?
peterbourgon
left a comment
There was a problem hiding this comment.
Waiting for the fix to sd/etcd
|
Apparently the user deleted the fork. I resubmitted the PR in #1168 |
|
Unless you intend to fix the etcd issue too, I'd just close it. |
|
I fixed that too. |
Description
This PR fixes a few issues that were affecting the code quality.
Summary of changes
strings.Indexwithstrings.Containsbytes.Comparewithbytes.Equal