internal/clientinfo: silent staticcheck S1008

The code is written for readability purpose.
This commit is contained in:
Cuong Manh Le
2023-12-06 15:39:00 +07:00
committed by Cuong Manh Le
parent 122600bff2
commit 0084e9ef26
2 changed files with 2 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ func (m *mdns) lookupIPByHostname(name string, v6 bool) string {
if value == name {
if addr, err := netip.ParseAddr(key.(string)); err == nil && addr.Is6() == v6 {
ip = addr.String()
//lint:ignore S1008 This is used for readable.
if addr.IsLoopback() { // Continue searching if this is loopback address.
return true
}

View File

@@ -104,6 +104,7 @@ func (p *ptrDiscover) lookupIPByHostname(name string, v6 bool) string {
if value == name {
if addr, err := netip.ParseAddr(key.(string)); err == nil && addr.Is6() == v6 {
ip = addr.String()
//lint:ignore S1008 This is used for readable.
if addr.IsLoopback() { // Continue searching if this is loopback address.
return true
}