Repository: raviqqe/muffet
Pull request #191 (2021-11-10 05:07:07)

Refactor

codecov[bot]: # [Codecov](https://codecov.io/gh/raviqqe/muffet/pull/191?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama) Report
> Merging [#191](https://codecov.io/gh/raviqqe/muffet/pull/191?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama) (068f7f1) into [master](https://codecov.io/gh/raviqqe/muffet/commit/5961bb83f836afd92fbb799d6ed7ced56d9f267a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama) (5961bb8) will **not change** coverage.
> The diff coverage is `37.50%`.

[![Impacted file tree graph](https://codecov.io/gh/raviqqe/muffet/pull/191/graphs/tree.svg?width=650&height=150&src=pr&token=qXJG42bGNw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama)](https://codecov.io/gh/raviqqe/muffet/pull/191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama)

```diff
@@           Coverage Diff           @@
##           master     #191   +/-   ##
=======================================
  Coverage   77.08%   77.08%           
=======================================
  Files          23       23           
  Lines         419      419           
=======================================
  Hits          323      323           
  Misses         80       80           
  Partials       16       16           
```


| [Impacted Files](https://codecov.io/gh/raviqqe/muffet/pull/191?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama) | Coverage Δ | |
|---|---|---|
| [fasthttp\_http\_client.go](https://codecov.io/gh/raviqqe/muffet/pull/191/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama#diff-ZmFzdGh0dHBfaHR0cF9jbGllbnQuZ28=) | `0.00% <0.00%> (ø)` | |
| [fasthttp\_http\_client\_factory.go](https://codecov.io/gh/raviqqe/muffet/pull/191/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama#diff-ZmFzdGh0dHBfaHR0cF9jbGllbnRfZmFjdG9yeS5nbw==) | `0.00% <0.00%> (ø)` | |
| [main.go](https://codecov.io/gh/raviqqe/muffet/pull/191/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama#diff-bWFpbi5nbw==) | `0.00% <0.00%> (ø)` | |
| [command.go](https://codecov.io/gh/raviqqe/muffet/pull/191/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama#diff-Y29tbWFuZC5nbw==) | `84.26% <100.00%> (ø)` | |
| [fasthttp\_http\_response.go](https://codecov.io/gh/raviqqe/muffet/pull/191/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama#diff-ZmFzdGh0dHBfaHR0cF9yZXNwb25zZS5nbw==) | `66.66% <100.00%> (ø)` | |
| [throttled\_http\_client.go](https://codecov.io/gh/raviqqe/muffet/pull/191/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama#diff-dGhyb3R0bGVkX2h0dHBfY2xpZW50Lmdv) | `75.00% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/raviqqe/muffet/pull/191?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/raviqqe/muffet/pull/191?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama). Last update [5961bb8...068f7f1](https://codecov.io/gh/raviqqe/muffet/pull/191?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yota+Toyama).


Patch:
diff --git a/command.go b/command.go
index 623c4d4..58a79e3 100644
--- a/command.go
+++ b/command.go
@@ -45,7 +45,7 @@ func (c *command) runWithError(ss []string) (bool, error) {
 		return false, errors.New("verbose option not supported for JSON output")
 	}
 
-	client := newThrottledHTTPClient(
+	client := newThrottledHttpClient(
 		c.httpClientFactory.Create(
 			httpClientOptions{
 				MaxConnectionsPerHost: args.MaxConnectionsPerHost,
diff --git a/fasthttp_http_client.go b/fasthttp_http_client.go
index 6fe6971..5049bd2 100644
--- a/fasthttp_http_client.go
+++ b/fasthttp_http_client.go
@@ -10,18 +10,18 @@ import (
 	"github.com/valyala/fasthttp"
 )
 
-type fasthttpHTTPClient struct {
+type fasthttpHttpClient struct {
 	client          *fasthttp.Client
 	maxRedirections int
 	timeout         time.Duration
 	headers         map[string]string
 }
 
-func newFasthttpHTTPClient(c *fasthttp.Client, maxRedirections int, timeout time.Duration, headers map[string]string) httpClient {
-	return &fasthttpHTTPClient{c, maxRedirections, timeout, headers}
+func newFasthttpHttpClient(c *fasthttp.Client, maxRedirections int, timeout time.Duration, headers map[string]string) httpClient {
+	return &fasthttpHttpClient{c, maxRedirections, timeout, headers}
 }
 
-func (c *fasthttpHTTPClient) Get(u *url.URL) (httpResponse, error) {
+func (c *fasthttpHttpClient) Get(u *url.URL) (httpResponse, error) {
 	req, res := fasthttp.Request{}, fasthttp.Response{}
 	req.SetRequestURI(u.String())
 	req.SetConnectionClose()
@@ -47,7 +47,7 @@ func (c *fasthttpHTTPClient) Get(u *url.URL) (httpResponse, error) {
 
 		switch res.StatusCode() / 100 {
 		case 2:
-			return newFasthttpHTTPResponse(req.URI(), &res), nil
+			return newFasthttpHttpResponse(req.URI(), &res), nil
 		case 3:
 			i++
 
diff --git a/fasthttp_http_client_factory.go b/fasthttp_http_client_factory.go
index 9fb5567..216031d 100644
--- a/fasthttp_http_client_factory.go
+++ b/fasthttp_http_client_factory.go
@@ -8,14 +8,14 @@ import (
 	"github.com/valyala/fasthttp/fasthttpproxy"
 )
 
-type fasthttpHTTPClientFactory struct {
+type fasthttpHttpClientFactory struct {
 }
 
-func newFasthttpHTTPClientFactory() *fasthttpHTTPClientFactory {
-	return &fasthttpHTTPClientFactory{}
+func newFasthttpHttpClientFactory() *fasthttpHttpClientFactory {
+	return &fasthttpHttpClientFactory{}
 }
 
-func (*fasthttpHTTPClientFactory) Create(o httpClientOptions) httpClient {
+func (*fasthttpHttpClientFactory) Create(o httpClientOptions) httpClient {
 	d := func(addr string) (net.Conn, error) {
 		return fasthttp.DialTimeout(addr, tcpTimeout)
 	}
@@ -24,7 +24,7 @@ func (*fasthttpHTTPClientFactory) Create(o httpClientOptions) httpClient {
 		d = fasthttpproxy.FasthttpHTTPDialerTimeout(o.Proxy, tcpTimeout)
 	}
 
-	return newFasthttpHTTPClient(
+	return newFasthttpHttpClient(
 		&fasthttp.Client{
 			MaxConnsPerHost: o.MaxConnectionsPerHost,
 			ReadBufferSize:  o.BufferSize,
diff --git a/fasthttp_http_response.go b/fasthttp_http_response.go
index 3cd545c..694a765 100644
--- a/fasthttp_http_response.go
+++ b/fasthttp_http_response.go
@@ -4,28 +4,28 @@ import (
 	"github.com/valyala/fasthttp"
 )
 
-type fasthttpHTTPResponse struct {
+type fasthttpHttpResponse struct {
 	url      *fasthttp.URI
 	response *fasthttp.Response
 }
 
-func newFasthttpHTTPResponse(u *fasthttp.URI, r *fasthttp.Response) httpResponse {
-	return fasthttpHTTPResponse{u, r}
+func newFasthttpHttpResponse(u *fasthttp.URI, r *fasthttp.Response) httpResponse {
+	return fasthttpHttpResponse{u, r}
 }
 
-func (r fasthttpHTTPResponse) URL() string {
+func (r fasthttpHttpResponse) URL() string {
 	return r.url.String()
 }
 
-func (r fasthttpHTTPResponse) StatusCode() int {
+func (r fasthttpHttpResponse) StatusCode() int {
 	return r.response.StatusCode()
 }
 
-func (r fasthttpHTTPResponse) Header(key string) string {
+func (r fasthttpHttpResponse) Header(key string) string {
 	return string(r.response.Header.Peek(key))
 }
 
-func (r fasthttpHTTPResponse) Body() ([]byte, error) {
+func (r fasthttpHttpResponse) Body() ([]byte, error) {
 	switch string(r.response.Header.Peek("Content-Encoding")) {
 	case "gzip":
 		return r.response.BodyGunzip()
diff --git a/main.go b/main.go
index 9b882a6..2913d19 100644
--- a/main.go
+++ b/main.go
@@ -12,7 +12,7 @@ func main() {
 		colorable.NewColorableStdout(),
 		os.Stderr,
 		isatty.IsTerminal(os.Stdout.Fd()),
-		newFasthttpHTTPClientFactory(),
+		newFasthttpHttpClientFactory(),
 	).Run(os.Args[1:])
 
 	if !ok {
diff --git a/throttled_http_client.go b/throttled_http_client.go
index 5495bdb..2d30f8a 100644
--- a/throttled_http_client.go
+++ b/throttled_http_client.go
@@ -7,23 +7,23 @@ import (
 )
 
 // TODO Throttle requests for each host.
-type throttledHTTPClient struct {
+type throttledHttpClient struct {
 	client    httpClient
 	limiter   ratelimit.Limiter
 	semaphore semaphore
 }
 
-func newThrottledHTTPClient(c httpClient, rps int, maxConnections int) httpClient {
+func newThrottledHttpClient(c httpClient, rps int, maxConnections int) httpClient {
 	l := ratelimit.NewUnlimited()
 
 	if rps > 0 {
 		l = ratelimit.New(rps)
 	}
 
-	return &throttledHTTPClient{c, l, newSemaphore(maxConnections)}
+	return &throttledHttpClient{c, l, newSemaphore(maxConnections)}
 }
 
-func (c *throttledHTTPClient) Get(u *url.URL) (httpResponse, error) {
+func (c *throttledHttpClient) Get(u *url.URL) (httpResponse, error) {
 	c.semaphore.Request()
 	defer c.semaphore.Release()
 


Test patch:
diff --git a/command_test.go b/command_test.go
index 637500d..6dfb901 100644
--- a/command_test.go
+++ b/command_test.go
@@ -13,38 +13,38 @@ import (
 	"github.com/stretchr/testify/assert"
 )
 
-func newTestCommand(h func(*url.URL) (*fakeHTTPResponse, error)) *command {
+func newTestCommand(h func(*url.URL) (*fakeHttpResponse, error)) *command {
 	return newTestCommandWithStdout(io.Discard, h)
 }
 
-func newTestCommandWithStdout(stdout io.Writer, h func(*url.URL) (*fakeHTTPResponse, error)) *command {
+func newTestCommandWithStdout(stdout io.Writer, h func(*url.URL) (*fakeHttpResponse, error)) *command {
 	return newCommand(
 		stdout,
 		io.Discard,
 		false,
-		newFakeHTTPClientFactory(h),
+		newFakeHttpClientFactory(h),
 	)
 }
 
-func newTestCommandWithStderr(stderr io.Writer, h func(*url.URL) (*fakeHTTPResponse, error)) *command {
+func newTestCommandWithStderr(stderr io.Writer, h func(*url.URL) (*fakeHttpResponse, error)) *command {
 	return newCommand(
 		io.Discard,
 		stderr,
 		false,
-		newFakeHTTPClientFactory(h),
+		newFakeHttpClientFactory(h),
 	)
 }
 
 func TestCommandRun(t *testing.T) {
 	ok := newTestCommand(
-		func(u *url.URL) (*fakeHTTPResponse, error) {
+		func(u *url.URL) (*fakeHttpResponse, error) {
 			s := "http://foo.com"
 
 			if u.String() != s {
 				return nil, errors.New("")
 			}
 
-			return newFakeHTTPResponse(200, s, "text/html", nil), nil
+			return newFakeHttpResponse(200, s, "text/html", nil), nil
 		},
 	).Run([]string{"http://foo.com"})
 
@@ -55,10 +55,10 @@ func TestCommandRunWithLinks(t *testing.T) {
 	visited := false
 
 	ok := newTestCommand(
-		func(u *url.URL) (*fakeHTTPResponse, error) {
+		func(u *url.URL) (*fakeHttpResponse, error) {
 			switch u.String() {
 			case "http://foo.com":
-				return newFakeHTTPResponse(
+				return newFakeHttpResponse(
 					200,
 					"http://foo.com",
 					"text/html",
@@ -66,7 +66,7 @@ func TestCommandRunWithLinks(t *testing.T) {
 				), nil
 			case "http://foo.com/foo":
 				visited = true
-				return newFakeHTTPResponse(200, "http://foo.com", "text/html", nil), nil
+				return newFakeHttpResponse(200, "http://foo.com", "text/html", nil), nil
 			}
 
 			return nil, errors.New("")
@@ -82,8 +82,8 @@ func TestCommandRunWithVerboseOption(t *testing.T) {
 
 	ok := newTestCommandWithStdout(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
-			return newFakeHTTPResponse(200, "http://foo.com", "text/html", nil), nil
+		func(u *url.URL) (*fakeHttpResponse, error) {
+			return newFakeHttpResponse(200, "http://foo.com", "text/html", nil), nil
 		},
 	).Run([]string{"-v", "http://foo.com"})
 
@@ -93,7 +93,7 @@ func TestCommandRunWithVerboseOption(t *testing.T) {
 
 func TestCommandFailToRun(t *testing.T) {
 	ok := newTestCommand(
-		func(u *url.URL) (*fakeHTTPResponse, error) {
+		func(u *url.URL) (*fakeHttpResponse, error) {
 			return nil, errors.New("")
 		},
 	).Run([]string{"http://foo.com"})
@@ -106,9 +106,9 @@ func TestCommandFailToRunWithInvalidLink(t *testing.T) {
 
 	ok := newTestCommandWithStdout(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
+		func(u *url.URL) (*fakeHttpResponse, error) {
 			if u.String() == "http://foo.com" {
-				return newFakeHTTPResponse(
+				return newFakeHttpResponse(
 					200,
 					"http://foo.com",
 					"text/html",
@@ -129,8 +129,8 @@ func TestCommandFailToParseArguments(t *testing.T) {
 
 	c := newTestCommandWithStderr(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
-			return newFakeHTTPResponse(200, "", "text/html", nil), nil
+		func(u *url.URL) (*fakeHttpResponse, error) {
+			return newFakeHttpResponse(200, "", "text/html", nil), nil
 		},
 	)
 
@@ -145,7 +145,7 @@ func TestCommandFailToFetchRootPage(t *testing.T) {
 
 	ok := newTestCommandWithStderr(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
+		func(u *url.URL) (*fakeHttpResponse, error) {
 			return nil, errors.New("foo")
 		},
 	).Run([]string{"http://foo.com"})
@@ -159,8 +159,8 @@ func TestCommandFailToGetHTMLRootPage(t *testing.T) {
 
 	ok := newTestCommandWithStderr(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
-			return newFakeHTTPResponse(200, "", "image/png", nil), nil
+		func(u *url.URL) (*fakeHttpResponse, error) {
+			return newFakeHttpResponse(200, "", "image/png", nil), nil
 		},
 	).Run([]string{"http://foo.com"})
 
@@ -175,7 +175,7 @@ func TestCommandColorErrorMessage(t *testing.T) {
 		io.Discard,
 		b,
 		true,
-		newFakeHTTPClientFactory(func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClientFactory(func(u *url.URL) (*fakeHttpResponse, error) {
 			return nil, errors.New("foo")
 		}),
 	)
@@ -191,8 +191,8 @@ func TestCommandShowHelp(t *testing.T) {
 
 	c := newTestCommandWithStdout(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
-			return newFakeHTTPResponse(200, "", "text/html", nil), nil
+		func(u *url.URL) (*fakeHttpResponse, error) {
+			return newFakeHttpResponse(200, "", "text/html", nil), nil
 		},
 	)
 
@@ -207,8 +207,8 @@ func TestCommandShowVersion(t *testing.T) {
 
 	c := newTestCommandWithStdout(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
-			return newFakeHTTPResponse(200, "", "text/html", nil), nil
+		func(u *url.URL) (*fakeHttpResponse, error) {
+			return newFakeHttpResponse(200, "", "text/html", nil), nil
 		},
 	)
 
@@ -225,9 +225,9 @@ func TestCommandFailToRunWithJSONOutput(t *testing.T) {
 
 	ok := newTestCommandWithStdout(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
+		func(u *url.URL) (*fakeHttpResponse, error) {
 			if u.String() == "http://foo.com" {
-				return newFakeHTTPResponse(
+				return newFakeHttpResponse(
 					200,
 					"http://foo.com",
 					"text/html",
@@ -248,8 +248,8 @@ func TestCommandDoNotIncludeSuccessfulPageInJSONOutput(t *testing.T) {
 
 	ok := newTestCommandWithStdout(
 		b,
-		func(u *url.URL) (*fakeHTTPResponse, error) {
-			return newFakeHTTPResponse(200, "", "text/html", nil), nil
+		func(u *url.URL) (*fakeHttpResponse, error) {
+			return newFakeHttpResponse(200, "", "text/html", nil), nil
 		},
 	).Run([]string{"--json", "http://foo.com"})
 
diff --git a/fake_http_client_factory_test.go b/fake_http_client_factory_test.go
index fe99fb0..4fc60f3 100644
--- a/fake_http_client_factory_test.go
+++ b/fake_http_client_factory_test.go
@@ -2,14 +2,14 @@ package main
 
 import "net/url"
 
-type fakeHTTPClientFactory struct {
-	handler func(*url.URL) (*fakeHTTPResponse, error)
+type fakeHttpClientFactory struct {
+	handler func(*url.URL) (*fakeHttpResponse, error)
 }
 
-func newFakeHTTPClientFactory(h func(*url.URL) (*fakeHTTPResponse, error)) httpClientFactory {
-	return &fakeHTTPClientFactory{h}
+func newFakeHttpClientFactory(h func(*url.URL) (*fakeHttpResponse, error)) httpClientFactory {
+	return &fakeHttpClientFactory{h}
 }
 
-func (f *fakeHTTPClientFactory) Create(httpClientOptions) httpClient {
-	return newFakeHTTPClient(f.handler)
+func (f *fakeHttpClientFactory) Create(httpClientOptions) httpClient {
+	return newFakeHttpClient(f.handler)
 }
diff --git a/fake_http_client_test.go b/fake_http_client_test.go
index 2e956bd..ffde74d 100644
--- a/fake_http_client_test.go
+++ b/fake_http_client_test.go
@@ -4,14 +4,14 @@ import (
 	"net/url"
 )
 
-type fakeHTTPClient struct {
-	handler func(*url.URL) (*fakeHTTPResponse, error)
+type fakeHttpClient struct {
+	handler func(*url.URL) (*fakeHttpResponse, error)
 }
 
-func newFakeHTTPClient(h func(*url.URL) (*fakeHTTPResponse, error)) *fakeHTTPClient {
-	return &fakeHTTPClient{h}
+func newFakeHttpClient(h func(*url.URL) (*fakeHttpResponse, error)) *fakeHttpClient {
+	return &fakeHttpClient{h}
 }
 
-func (c *fakeHTTPClient) Get(u *url.URL) (httpResponse, error) {
+func (c *fakeHttpClient) Get(u *url.URL) (httpResponse, error) {
 	return c.handler(u)
 }
diff --git a/fake_http_response_test.go b/fake_http_response_test.go
index 3e263ae..cb7a8c9 100644
--- a/fake_http_response_test.go
+++ b/fake_http_response_test.go
@@ -2,26 +2,26 @@ package main
 
 import "strings"
 
-type fakeHTTPResponse struct {
+type fakeHttpResponse struct {
 	statusCode  int
 	location    string
 	contentType string
 	body        []byte
 }
 
-func newFakeHTTPResponse(statusCode int, location string, contentType string, body []byte) *fakeHTTPResponse {
-	return &fakeHTTPResponse{statusCode, location, contentType, body}
+func newFakeHttpResponse(statusCode int, location string, contentType string, body []byte) *fakeHttpResponse {
+	return &fakeHttpResponse{statusCode, location, contentType, body}
 }
 
-func (r *fakeHTTPResponse) URL() string {
+func (r *fakeHttpResponse) URL() string {
 	return r.location
 }
 
-func (r *fakeHTTPResponse) StatusCode() int {
+func (r *fakeHttpResponse) StatusCode() int {
 	return r.statusCode
 }
 
-func (r *fakeHTTPResponse) Header(name string) string {
+func (r *fakeHttpResponse) Header(name string) string {
 	if strings.ToLower(name) == "content-type" {
 		return r.contentType
 	}
@@ -29,6 +29,6 @@ func (r *fakeHTTPResponse) Header(name string) string {
 	return ""
 }
 
-func (r *fakeHTTPResponse) Body() ([]byte, error) {
+func (r *fakeHttpResponse) Body() ([]byte, error) {
 	return r.body, nil
 }
diff --git a/fasthttp_http_response_test.go b/fasthttp_http_response_test.go
index 81d451d..f094f25 100644
--- a/fasthttp_http_response_test.go
+++ b/fasthttp_http_response_test.go
@@ -11,7 +11,7 @@ import (
 	"github.com/valyala/fasthttp"
 )
 
-func TestFastHTTPResponseDecodeGzipBody(t *testing.T) {
+func TestFastHttpResponseDecodeGzipBody(t *testing.T) {
 	b := bytes.Buffer{}
 	w := gzip.NewWriter(&b)
 	_, err := w.Write([]byte("foo"))
@@ -23,13 +23,13 @@ func TestFastHTTPResponseDecodeGzipBody(t *testing.T) {
 	r.Header.Add("Content-Encoding", "gzip")
 	r.SetBody(b.Bytes())
 
-	bs, err := newFasthttpHTTPResponse(nil, &r).Body()
+	bs, err := newFasthttpHttpResponse(nil, &r).Body()
 
 	assert.Nil(t, err)
 	assert.Equal(t, "foo", string(bs))
 }
 
-func TestFastHTTPResponseDecodeDeflateBody(t *testing.T) {
+func TestFastHttpResponseDecodeDeflateBody(t *testing.T) {
 	b := bytes.Buffer{}
 	w := zlib.NewWriter(&b)
 	_, err := w.Write([]byte("foo"))
@@ -41,13 +41,13 @@ func TestFastHTTPResponseDecodeDeflateBody(t *testing.T) {
 	r.Header.Add("Content-Encoding", "deflate")
 	r.SetBody(b.Bytes())
 
-	bs, err := newFasthttpHTTPResponse(nil, &r).Body()
+	bs, err := newFasthttpHttpResponse(nil, &r).Body()
 
 	assert.Nil(t, err)
 	assert.Equal(t, "foo", string(bs))
 }
 
-func TestFastHTTPResponseDecodeBrotliBody(t *testing.T) {
+func TestFastHttpResponseDecodeBrotliBody(t *testing.T) {
 	b := bytes.Buffer{}
 	w := brotli.NewWriter(&b)
 	_, err := w.Write([]byte("foo"))
@@ -59,7 +59,7 @@ func TestFastHTTPResponseDecodeBrotliBody(t *testing.T) {
 	r.Header.Add("Content-Encoding", "br")
 	r.SetBody(b.Bytes())
 
-	bs, err := newFasthttpHTTPResponse(nil, &r).Body()
+	bs, err := newFasthttpHttpResponse(nil, &r).Body()
 
 	assert.Nil(t, err)
 	assert.Equal(t, "foo", string(bs))
diff --git a/link_fetcher_test.go b/link_fetcher_test.go
index bff6a4b..9899a0a 100644
--- a/link_fetcher_test.go
+++ b/link_fetcher_test.go
@@ -10,27 +10,27 @@ import (
 	"github.com/stretchr/testify/assert"
 )
 
-func newTestLinkFetcher(c *fakeHTTPClient) *linkFetcher {
+func newTestLinkFetcher(c *fakeHttpClient) *linkFetcher {
 	return newTestLinkFetcherWithOptions(c, linkFetcherOptions{})
 }
 
-func newTestLinkFetcherWithOptions(c *fakeHTTPClient, o linkFetcherOptions) *linkFetcher {
+func newTestLinkFetcherWithOptions(c *fakeHttpClient, o linkFetcherOptions) *linkFetcher {
 	return newLinkFetcher(c, newPageParser(newLinkFinder(nil)), o)
 }
 
 func TestNewFetcher(t *testing.T) {
-	newTestLinkFetcher(newFakeHTTPClient(nil))
+	newTestLinkFetcher(newFakeHttpClient(nil))
 }
 
 func TestLinkFetcherFetch(t *testing.T) {
 	f := newTestLinkFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				if u.String() != "http://foo.com" {
 					return nil, errors.New("")
 				}
 
-				return newFakeHTTPResponse(
+				return newFakeHttpResponse(
 					200,
 					"http://foo.com",
 					"text/html",
@@ -51,15 +51,15 @@ func TestLinkFetcherFetchFromCache(t *testing.T) {
 	s := "http://foo.com"
 
 	f := newTestLinkFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				if !ok {
 					return nil, errors.New("")
 				}
 
 				ok = false
 
-				return newFakeHTTPResponse(
+				return newFakeHttpResponse(
 					200,
 					s,
 					"text/html",
@@ -83,11 +83,11 @@ func TestLinkFetcherFetchCacheConcurrency(t *testing.T) {
 	c := 0
 
 	f := newTestLinkFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				c++
 
-				return newFakeHTTPResponse(200, "http://foo.com", "text/html", nil), nil
+				return newFakeHttpResponse(200, "http://foo.com", "text/html", nil), nil
 			}),
 	)
 
@@ -113,13 +113,13 @@ func TestLinkFetcherFetchCacheConcurrency(t *testing.T) {
 func TestLinkFetcherFetchWithFragments(t *testing.T) {
 	s := "http://foo.com"
 	f := newTestLinkFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				if u.String() != s {
 					return nil, errors.New("")
 				}
 
-				return newFakeHTTPResponse(200, s, "text/html", []byte(`<p id="foo" />`)), nil
+				return newFakeHttpResponse(200, s, "text/html", []byte(`<p id="foo" />`)), nil
 			},
 		),
 	)
@@ -138,13 +138,13 @@ func TestLinkFetcherFetchWithFragments(t *testing.T) {
 func TestLinkFetcherFetchIgnoringFragments(t *testing.T) {
 	s := "http://foo.com"
 	f := newTestLinkFetcherWithOptions(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				if u.String() != s {
 					return nil, errors.New("")
 				}
 
-				return newFakeHTTPResponse(200, s, "text/html", nil), nil
+				return newFakeHttpResponse(200, s, "text/html", nil), nil
 			},
 		),
 		linkFetcherOptions{IgnoreFragments: true},
@@ -156,7 +156,7 @@ func TestLinkFetcherFetchIgnoringFragments(t *testing.T) {
 
 func TestLinkFetcherFailToFetch(t *testing.T) {
 	f := newTestLinkFetcher(
-		newFakeHTTPClient(func(*url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(func(*url.URL) (*fakeHttpResponse, error) {
 			return nil, errors.New("")
 		}))
 
@@ -167,8 +167,8 @@ func TestLinkFetcherFailToFetch(t *testing.T) {
 
 func TestLinkFetcherFailToParseURL(t *testing.T) {
 	f := newTestLinkFetcher(
-		newFakeHTTPClient(func(*url.URL) (*fakeHTTPResponse, error) {
-			return newFakeHTTPResponse(200, "", "text/html", nil), nil
+		newFakeHttpClient(func(*url.URL) (*fakeHttpResponse, error) {
+			return newFakeHttpResponse(200, "", "text/html", nil), nil
 		}))
 
 	_, _, err := f.Fetch(":")
diff --git a/page_checker_test.go b/page_checker_test.go
index 35f558e..36ab260 100644
--- a/page_checker_test.go
+++ b/page_checker_test.go
@@ -8,7 +8,7 @@ import (
 	"github.com/stretchr/testify/assert"
 )
 
-func newTestPageChecker(c *fakeHTTPClient) *pageChecker {
+func newTestPageChecker(c *fakeHttpClient) *pageChecker {
 	return newPageChecker(
 		newLinkFetcher(
 			c,
@@ -29,8 +29,8 @@ func newTestPage(t *testing.T, fragments map[string]struct{}, links map[string]e
 
 func TestPageCheckerCheckOnePage(t *testing.T) {
 	c := newTestPageChecker(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				return nil, errors.New("")
 			},
 		),
@@ -50,15 +50,15 @@ func TestPageCheckerCheckOnePage(t *testing.T) {
 
 func TestPageCheckerCheckTwoPages(t *testing.T) {
 	c := newTestPageChecker(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				s := "http://foo.com/foo"
 
 				if u.String() != s {
 					return nil, errors.New("")
 				}
 
-				return newFakeHTTPResponse(200, s, "text/html", nil), nil
+				return newFakeHttpResponse(200, s, "text/html", nil), nil
 			},
 		),
 	)
@@ -79,8 +79,8 @@ func TestPageCheckerCheckTwoPages(t *testing.T) {
 
 func TestPageCheckerFailToCheckPage(t *testing.T) {
 	c := newTestPageChecker(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				return nil, errors.New("")
 			},
 		),
@@ -95,9 +95,9 @@ func TestPageCheckerFailToCheckPage(t *testing.T) {
 
 func TestPageCheckerDoNotCheckSamePageTwice(t *testing.T) {
 	c := newTestPageChecker(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
-				return newFakeHTTPResponse(200, "http://foo.com", "text/html", nil), nil
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
+				return newFakeHttpResponse(200, "http://foo.com", "text/html", nil), nil
 			},
 		),
 	)
diff --git a/robots_txt_fetcher_test.go b/robots_txt_fetcher_test.go
index 9eaf545..8bc8044 100644
--- a/robots_txt_fetcher_test.go
+++ b/robots_txt_fetcher_test.go
@@ -15,13 +15,13 @@ func TestRobotsTxtFetcherFetchRobotsTxt(t *testing.T) {
 	assert.Nil(t, err)
 
 	r, err := newRobotsTxtFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				if u.String() != s+"/robots.txt" {
 					return nil, errors.New("")
 				}
 
-				return newFakeHTTPResponse(
+				return newFakeHttpResponse(
 					200,
 					s,
 					"text/plain",
@@ -41,8 +41,8 @@ func TestRobotsTxtFetcherFailToFetchRobotsTxt(t *testing.T) {
 	assert.Nil(t, err)
 
 	_, err = newRobotsTxtFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				return nil, errors.New("foo")
 			})).Fetch(u)
 
diff --git a/sitemap_fetcher_test.go b/sitemap_fetcher_test.go
index 98a0e97..51b97cb 100644
--- a/sitemap_fetcher_test.go
+++ b/sitemap_fetcher_test.go
@@ -15,13 +15,13 @@ func TestSitemapFetcherFetchSitemap(t *testing.T) {
 	assert.Nil(t, err)
 
 	sm, err := newSitemapFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				if u.String() != s+"/sitemap.xml" {
 					return nil, errors.New("")
 				}
 
-				return newFakeHTTPResponse(
+				return newFakeHttpResponse(
 					200,
 					s,
 					"text/xml",
@@ -47,8 +47,8 @@ func TestSitemapFetcherFailToFetchSitemap(t *testing.T) {
 	assert.Nil(t, err)
 
 	_, err = newSitemapFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
 				return nil, errors.New("foo")
 			},
 		),
@@ -62,9 +62,9 @@ func TestSitemapFetcherFailToParseSitemap(t *testing.T) {
 	assert.Nil(t, err)
 
 	_, err = newSitemapFetcher(
-		newFakeHTTPClient(
-			func(u *url.URL) (*fakeHTTPResponse, error) {
-				return newFakeHTTPResponse(200, "", "text/xml", []byte(`<`)), nil
+		newFakeHttpClient(
+			func(u *url.URL) (*fakeHttpResponse, error) {
+				return newFakeHttpResponse(200, "", "text/xml", []byte(`<`)), nil
 			},
 		),
 	).Fetch(u)