mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-27 17:41:13 +02:00
Be idiomatic. Use a switch instead of if/else
This commit is contained in:
parent
01fac00f20
commit
1df788a73c
@ -521,10 +521,14 @@ func (c *ConsulBackend) reconcileConsul(registeredServiceID string, activeFunc a
|
||||
tags := serviceTags(active)
|
||||
|
||||
var reregister bool
|
||||
if currentVaultService == nil || registeredServiceID == "" {
|
||||
switch {
|
||||
case currentVaultService == nil,
|
||||
registeredServiceID == "":
|
||||
reregister = true
|
||||
} else {
|
||||
if len(currentVaultService.Tags) != 1 || currentVaultService.Tags[0] != tags[0] {
|
||||
default:
|
||||
switch {
|
||||
case len(currentVaultService.Tags) != 1,
|
||||
currentVaultService.Tags[0] != tags[0]:
|
||||
reregister = true
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user