~mendelmaleh/xkcd

ed73e79a65231f2d79850408754d0f9c6423701e — Mendel E 2 years ago 41f18bb
Export default baseurl, use a pointer to http.Client
1 files changed, 5 insertions(+), 3 deletions(-)

M xkcd.go
M xkcd.go => xkcd.go +5 -3
@@ 10,10 10,12 @@ import (
	"time"
)

var DefaultBaseURL = "https://xkcd.com/"

// XKCD client
type XKCD struct {
	BaseURL string
	Client  http.Client
	Client  *http.Client
}

// Comic from xkcd


@@ 47,8 49,8 @@ type APIResponse struct {
// New returns an instance of the xkcd client.
func New() *XKCD {
	return &XKCD{
		BaseURL: "https://xkcd.com/",
		Client:  *http.DefaultClient,
		BaseURL: DefaultBaseURL,
		Client:  http.DefaultClient,
	}
}