diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-05-25 20:33:06 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-05-25 20:33:06 +0200 |
commit | dae31bb0192e6b519111d3cb80ddd4312cda306c (patch) | |
tree | 132f610d3e2d71ec396f6a3cd960ac33aad35df2 /internal/http | |
parent | 3cbf95d38b6f8bd17b4312371ed07e6847ff0f5c (diff) | |
download | feed2imap-go-dae31bb0192e6b519111d3cb80ddd4312cda306c.tar.gz feed2imap-go-dae31bb0192e6b519111d3cb80ddd4312cda306c.tar.bz2 feed2imap-go-dae31bb0192e6b519111d3cb80ddd4312cda306c.zip |
'Exec' as an alternative to 'Url'
Diffstat (limited to 'internal/http')
-rw-r--r-- | internal/http/client.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/http/client.go b/internal/http/client.go index c9af26e..230c333 100644 --- a/internal/http/client.go +++ b/internal/http/client.go @@ -35,7 +35,7 @@ func init() { unsafeClient = &http.Client{Transport: transport} } -func context(timeout int) (ctxt.Context, ctxt.CancelFunc) { +func Context(timeout int) (ctxt.Context, ctxt.CancelFunc) { return ctxt.WithTimeout(ctxt.Background(), time.Duration(timeout)*time.Second) } @@ -50,7 +50,7 @@ var noop ctxt.CancelFunc = func() {} func Get(url string, timeout int, disableTLS bool) (resp *http.Response, cancel ctxt.CancelFunc, err error) { prematureExit := true - ctx, ctxCancel := context(timeout) + ctx, ctxCancel := Context(timeout) cancel = func() { if resp != nil { |