chore: code cleanup

This commit is contained in:
wwqgtxx
2023-10-25 18:07:45 +08:00
parent fc5a3cf80c
commit c1f24d8f0e
7 changed files with 5 additions and 45 deletions

View File

@@ -306,7 +306,7 @@ func batchExchange(ctx context.Context, clients []dnsClient, m *D.Msg) (msg *D.M
domain := msgToDomain(m)
for _, client := range clients {
if _, isRCodeClient := client.(rcodeClient); isRCodeClient {
msg, err = client.Exchange(m)
msg, err = client.ExchangeContext(ctx, m)
return msg, false, err
}
client := client // shadow define client to ensure the value captured by the closure will not be changed in the next loop