Skip to content

Commit

Permalink
fix!: renamed WithHttpClient -> WithHTTPClient.
Browse files Browse the repository at this point in the history
BREAKING CHANGES: lets follow Go lang standard naming.
  • Loading branch information
dknight committed Mar 13, 2023
1 parent a52536c commit 22279c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}

Expand Down
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 22279c7

Please sign in to comment.