mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
Fix staticcheck linter
This commit is contained in:
committed by
Cuong Manh Le
parent
fb807d7c37
commit
ef7432df55
@@ -75,11 +75,7 @@ func (m *mdns) lookupIPByHostname(name string, v6 bool) string {
|
|||||||
if value == name {
|
if value == name {
|
||||||
if addr, err := netip.ParseAddr(key.(string)); err == nil && addr.Is6() == v6 {
|
if addr, err := netip.ParseAddr(key.(string)); err == nil && addr.Is6() == v6 {
|
||||||
ip = addr.String()
|
ip = addr.String()
|
||||||
//lint:ignore S1008 This is used for readable.
|
return addr.IsLoopback() // Continue searching if this is loopback address.
|
||||||
if addr.IsLoopback() { // Continue searching if this is loopback address.
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -357,8 +357,9 @@ func Test_legacyResolverWithBigExtraSection(t *testing.T) {
|
|||||||
Type: ResolverTypeLegacy,
|
Type: ResolverTypeLegacy,
|
||||||
Endpoint: lanAddr,
|
Endpoint: lanAddr,
|
||||||
}
|
}
|
||||||
uc.Init()
|
ctx := context.Background()
|
||||||
r, err := NewResolver(uc)
|
uc.Init(ctx)
|
||||||
|
r, err := NewResolver(ctx, uc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user