From 22279c79f22abd1f28b322444b0deac39c9aa5e3 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Mon, 13 Mar 2023 02:51:49 +0200 Subject: [PATCH] fix!: renamed WithHttpClient -> WithHTTPClient. BREAKING CHANGES: lets follow Go lang standard naming. --- client.go | 4 ++-- client_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 24a1eed..4773f93 100644 --- a/client.go +++ b/client.go @@ -38,8 +38,8 @@ type optionFunc func(*Client) func (o optionFunc) apply(c *Client) { o(c) } -// WithHttpClient specifies which http client to use. -func WithHttpClient(httpClient *http.Client) Option { +// WithHTTPClient specifies which http client to use. +func WithHTTPClient(httpClient *http.Client) Option { return optionFunc(func(c *Client) { c.httpClient = httpClient }) } diff --git a/client_test.go b/client_test.go index 08e9024..1a9f520 100644 --- a/client_test.go +++ b/client_test.go @@ -574,11 +574,11 @@ func TestNewClient(t *testing.T) { t.Run("specify http client", func(t *testing.T) { t.Parallel() - httpClient := new(http.Client) // ??? + httpClient := &http.Client{} client := NewClient( "https://sid.demo.sk.ee/smart-id-rp/v2/", 10000, - WithHttpClient(httpClient), + WithHTTPClient(httpClient), ) if client.httpClient != httpClient {