code: func useProxy(addr string) bool {
  	if len(addr) == 0 {
  		return true
  	}
  	host, _, err := net.SplitHostPort(addr)
  	if err != nil {
  		return false
  	}
  	if host == "localhost" {
  		return false
  	}
  	if ip := net.ParseIP(host); ip != nil {
  		if ip.IsLoopback() {
  			return false
  		}
  	}
  
  	no_proxy := getenvEitherCase("NO_PROXY")
  	if no_proxy == "*" {
  		return false
  	}
  
  	addr = strings.ToLower(strings.TrimSpace(addr))
  	if hasPort(addr) {
  		addr = addr[:strings.LastIndex(addr, ":")]
  	}
  
  	for _, p := range strings.Split(no_proxy, ",") {
  		p = strings.ToLower(strings.TrimSpace(p))
  		if len(p) == 0 {
  			continue
  		}
  		if hasPort(p) {
  			p = p[:strings.LastIndex(p, ":")]
  		}
  		if addr == p || (p[0] == '.' && (strings.HasSuffix(addr, p) || addr == p[1:])) {
  			return false
  		}
  	}
  	return true
  }
docs: // useProxy returns true if requests to addr should use a proxy,
  // according to the NO_PROXY or no_proxy environment variable.
  // addr is always a canonicalAddr with a host and port.