mirror of
https://github.com/minio/minio.git
synced 2026-06-04 10:13:48 +08:00
add gocritic/ruleguard checks back again, cleanup code. (#13665)
- remove some duplicated code - reported a bug, separately fixed in #13664 - using strings.ReplaceAll() when needed - using filepath.ToSlash() use when needed - remove all non-Go style comments from the codebase Co-authored-by: Aditya Manthramurthy <donatello@users.noreply.github.com>
This commit is contained in:
+4
-8
@@ -341,21 +341,17 @@ func sameLocalAddrs(addr1, addr2 string) (bool, error) {
|
||||
if host1 == "" {
|
||||
// If empty host means it is localhost
|
||||
addr1Local = true
|
||||
} else {
|
||||
} else if addr1Local, err = isLocalHost(host1, port1, port1); err != nil {
|
||||
// Host not empty, check if it is local
|
||||
if addr1Local, err = isLocalHost(host1, port1, port1); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
|
||||
if host2 == "" {
|
||||
// If empty host means it is localhost
|
||||
addr2Local = true
|
||||
} else {
|
||||
} else if addr2Local, err = isLocalHost(host2, port2, port2); err != nil {
|
||||
// Host not empty, check if it is local
|
||||
if addr2Local, err = isLocalHost(host2, port2, port2); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
|
||||
// If both of addresses point to the same machine, check if
|
||||
|
||||
Reference in New Issue
Block a user