mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Improve readability: use of a switch vs two if's
This commit is contained in:
@@ -55,12 +55,11 @@ func (f *NetworkFingerprint) Fingerprint(cfg *config.Config, node *structs.Node)
|
||||
var ip string
|
||||
|
||||
intf, err := f.findInterface(cfg.NetworkInterface)
|
||||
if err != nil {
|
||||
switch {
|
||||
case err != nil:
|
||||
return false, fmt.Errorf("Error while detecting network interface during fingerprinting: %v", err)
|
||||
}
|
||||
|
||||
// No interface could be found
|
||||
if intf == nil {
|
||||
case intf == nil:
|
||||
// No interface could be found
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user