Golang http 超时设置方法
c := http.Client{ Transport: &http.Transport{ Dial: func(netw, addr string) (net.Conn, error) { deadline := time.Now().Add(25 * time.Second) c, err := net.DialTimeout(netw, addr, time.Second*20) if err != nil { return nil, err } c.SetDeadline(deadlin...阅读全文