func (r *Resolver) ResolveWithMaxAge(name string, ipVer int, maxAge time.Duration) (net.IP, error) {
	cr := r.getCacheRecord(name)
	cr.refreshIfRequired(name, r.resolve, maxAge)
	cr.mu.Lock()
	defer cr.mu.Unlock()
	ip := cr.ip4
	if ipVer == 6 {
		ip = cr.ip6
	}
	if ip == nil && cr.err == nil {
		return nil, fmt.Errorf("found no IP%d IP for %s", ipVer, name)
	}
	return ip, cr.err
}
// ResolveWithMaxAge returns IP address for a name, issuing an update call for the cache record if
// it's older than the argument maxAge.
ResolveWithMaxAge returns IP address for a name, issuing an update call for the cache record if
it's older than the argument maxAge.
// ResolveWithMaxAge returns IP address for a name issuing an update call for the cache record if // it ' s older than the argument maxAge .
func (r *Resolver) ResolveWithMaxAge(name string, ipVer int, maxAge time.Duration) (net.IP, error) {
	cr := r.getCacheRecord(name)
	cr.refreshIfRequired(name, r.resolve, maxAge)
	cr.mu.Lock()
	defer cr.mu.Unlock()
	ip := cr.ip4
	if ipVer == 6 {
		ip = cr.ip6
	}
	if ip == nil && cr.err == nil {
		return nil, fmt.Errorf("found no IP%d IP for %s", ipVer, name)
	}
	return ip, cr.err
}
func ( r * Resolver ) ResolveWithMaxAge ( name string , ipVer int , maxAge time . Duration ) ( net . IP , error ) { cr := r . getCacheRecord ( name ) cr . refreshIfRequired ( name , r . resolve , maxAge ) cr . mu . Lock ( ) defer cr . mu . Unlock ( ) ip := cr . ip4 if ipVer == 6 { ip = cr . ip6 } if ip == nil && cr . err == nil { return nil , fmt . Errorf ( " " , ipVer , name ) } return ip , cr . err }
ResolveWithMaxAge returns IP address for a name, issuing an update call for the cache record if
it's older than the argument maxAge.
ResolveWithMaxAge returns IP address for a name issuing an update call for the cache record if it ' s older than the argument maxAge .