code: func DialTimeout(network, addr string, timeout time.Duration) (net.Conn, error) {
  	if usingProxy {
  		// Because the proxy package is poorly structured, we have to
  		// construct a struct that matches proxy.Dialer but has a timeout
  		// and reconstrcut the proxy dialer using that, in order to be able to
  		// set a timeout.
  		dd := &timeoutDirectDialer{
  			timeout: timeout,
  		}
  		// Check if the dialer we are getting is not timeoutDirectDialer we just
  		// created. It could happen that usingProxy is true, but getDialer
  		// returns timeoutDirectDialer due to env vars changing.
  		if timeoutProxyDialer := getDialer(dd); timeoutProxyDialer != dd {
  			directDialFunc := func(inetwork, iaddr string) (net.Conn, error) {
  				return net.DialTimeout(inetwork, iaddr, timeout)
  			}
  			return dialWithFallback(timeoutProxyDialer.Dial, directDialFunc, network, addr)
  		}
  	}
  	return net.DialTimeout(network, addr, timeout)
  }
docs: // DialTimeout tries dialing via proxy with a timeout if a proxy is configured,
  // and falls back to a direct connection if no proxy is defined, or connecting
  // via proxy fails. The timeout can potentially be applied twice, once trying
  // to connect via the proxy connection, and second time trying to connect
  // directly.