1 Star 2 Fork 0

api-go/iris

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
client.go 535 Bytes
Copy Edit Raw Blame History
package netutil
import (
"net"
"net/http"
"time"
"github.com/kataras/golog"
)
// Client returns a new http.Client using
// the "timeout" for open connection.
func Client(timeout time.Duration) *http.Client {
transport := http.Transport{
Dial: func(network string, addr string) (net.Conn, error) {
conn, err := net.DialTimeout(network, addr, timeout)
if err != nil {
golog.Debugf("%v", err)
return nil, err
}
return conn, err
},
}
client := &http.Client{
Transport: &transport,
}
return client
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/netscript/iris.git
git@gitee.com:netscript/iris.git
netscript
iris
iris
v10.6.3

Search