mirror of
https://github.com/diamondburned/arikawa.git
synced 2025-02-08 20:47:13 +00:00
utils: dont set http.Client timeout to a default value
This commit is contained in:
parent
67f94a835a
commit
6f5a53063f
|
@ -5,7 +5,6 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultClient implements Client and wraps around the stdlib Client.
|
// DefaultClient implements Client and wraps around the stdlib Client.
|
||||||
|
@ -19,12 +18,9 @@ func WrapClient(client http.Client) Client {
|
||||||
return DefaultClient(client)
|
return DefaultClient(client)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewClient creates a new client around the standard library's http.Client. The
|
// NewClient creates a new client around the standard library's http.Client.
|
||||||
// client will have a timeout of 10 seconds.
|
|
||||||
func NewClient() Client {
|
func NewClient() Client {
|
||||||
return WrapClient(http.Client{
|
return WrapClient(http.Client{})
|
||||||
Timeout: 10 * time.Second,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d DefaultClient) NewRequest(ctx context.Context, method, url string) (Request, error) {
|
func (d DefaultClient) NewRequest(ctx context.Context, method, url string) (Request, error) {
|
||||||
|
|
Loading…
Reference in a new issue