From ee1a3d8e5278a4a4e8435f9129852b95a9c22afb Mon Sep 17 00:00:00 2001 From: ale Date: Fri, 31 Aug 2018 08:29:14 +0100 Subject: Improve error checking Detect write errors (both on the database and to the WARC output) and abort with an error message. Also fix a bunch of harmless lint warnings. --- client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'client.go') diff --git a/client.go b/client.go index c0c2626..45736f5 100644 --- a/client.go +++ b/client.go @@ -9,18 +9,18 @@ import ( var defaultClientTimeout = 60 * time.Second -var DefaultClient *http.Client - // DefaultClient returns a http.Client suitable for crawling: does not // follow redirects, accepts invalid TLS certificates, sets a // reasonable timeout for requests. +var DefaultClient *http.Client + func init() { - jar, _ := cookiejar.New(nil) + jar, _ := cookiejar.New(nil) // nolint DefaultClient = &http.Client{ Timeout: defaultClientTimeout, Transport: &http.Transport{ TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, + InsecureSkipVerify: true, // nolint }, }, CheckRedirect: func(req *http.Request, via []*http.Request) error { -- cgit v1.2.3-54-g00ecf