mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-28 10:01:11 +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)
|
tags := serviceTags(active)
|
||||||
|
|
||||||
var reregister bool
|
var reregister bool
|
||||||
if currentVaultService == nil || registeredServiceID == "" {
|
switch {
|
||||||
|
case currentVaultService == nil,
|
||||||
|
registeredServiceID == "":
|
||||||
reregister = true
|
reregister = true
|
||||||
} else {
|
default:
|
||||||
if len(currentVaultService.Tags) != 1 || currentVaultService.Tags[0] != tags[0] {
|
switch {
|
||||||
|
case len(currentVaultService.Tags) != 1,
|
||||||
|
currentVaultService.Tags[0] != tags[0]:
|
||||||
reregister = true
|
reregister = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user