code: func useProxy(noProxy, addr string) bool {
  	if len(addr) == 0 {
  		return true
  	}
  
  	if noProxy == "*" {
  		return false
  	}
  
  	addr = strings.ToLower(strings.TrimSpace(addr))
  	if hasPort(addr) {
  		addr = addr[:strings.LastIndex(addr, ":")]
  	}
  
  	for _, p := range strings.Split(noProxy, ",") {
  		p = strings.ToLower(strings.TrimSpace(p))
  		if len(p) == 0 {
  			continue
  		}
  		if hasPort(p) {
  			p = p[:strings.LastIndex(p, ":")]
  		}
  		if addr == p {
  			return false
  		}
  		if p[0] == '.' && (strings.HasSuffix(addr, p) || addr == p[1:]) {
  			// noProxy ".foo.com" matches "bar.foo.com" or "foo.com"
  			return false
  		}
  		if p[0] != '.' && strings.HasSuffix(addr, p) && addr[len(addr)-len(p)-1] == '.' {
  			// noProxy "foo.com" matches "bar.foo.com"
  			return false
  		}
  	}
  	return true
  }
docs: // useProxy reports whether requests to addr should use a proxy,
  // according to the noProxy or noProxy environment variable.
  // addr is always a canonicalAddr with a host and port.
  // Copied from "net/http".ProxyFromEnvironment in the go std lib
  // and adapted to allow proxy usage even for localhost.