yarpc / yarpc-go

A message passing platform for Go
MIT License
404 stars 102 forks source link

Switch case fall through requires `fallthrough` keyword #1898

Closed justinjc closed 4 years ago

justinjc commented 4 years ago

The comment here suggests that we want this case to fall through, but this needs an explicit fallthrough keyword to work.

https://github.com/yarpc/yarpc-go/blob/83d7c24798f05a6e056f4b50e1af968dc938d934/yarpcconfig/chooser.go#L297

peats-bond commented 4 years ago

Hey @justinjc, in this case I believe that the behavior is correct and that fall through is a poor choice of words given the context. The only acceptable number of peer list updaters for a single outbound config is one.

Note that the the zero and +1 cases return early with an error, so the correct case logic continues after the switch. Feel free to re-open if you find some reproducible buggy logic!

justinjc commented 4 years ago

Ah I see, makes sense. Thanks!