add context for modules

This commit is contained in:
ginuerzh
2023-04-18 20:46:44 +08:00
parent f3482d7cd8
commit a2115a3d38
8 changed files with 24 additions and 15 deletions

View File

@ -24,7 +24,7 @@ func Resolve(ctx context.Context, network, addr string, r resolver.Resolver, hos
}
if hosts != nil {
if ips, _ := hosts.Lookup(network, host); len(ips) > 0 {
if ips, _ := hosts.Lookup(ctx, network, host); len(ips) > 0 {
log.Debugf("hit host mapper: %s -> %s", host, ips)
return net.JoinHostPort(ips[0].String(), port), nil
}