Skip to content

Commit 330a10b

Browse files
committed
fix: improve ClientWithHeader option name
1 parent 9c9c23d commit 330a10b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

http/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ func ClientWithUserAgent(ua string) ClientOpt {
4141
}
4242
}
4343

44-
// ClientWithHeaders specifies the HTTP header for the client.
45-
func ClientWithHeaders(key, value string) ClientOpt {
44+
// ClientWithHeader adds an HTTP header to the client.
45+
func ClientWithHeader(key, value string) ClientOpt {
4646
return func(c *client) {
4747
if c.headers == nil {
4848
c.headers = map[string]string{}

http/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func TestClientHeader(t *testing.T) {
126126
testClient := s.Client()
127127
tc.host = s.URL
128128
r := &cmds.Request{Path: tc.path, Command: &cmds.Command{}, Root: &cmds.Command{}}
129-
c := NewClient(tc.host, ClientWithHeaders(tc.header, tc.value)).(*client)
129+
c := NewClient(tc.host, ClientWithHeader(tc.header, tc.value)).(*client)
130130
c.httpClient = testClient
131131
c.send(r)
132132

0 commit comments

Comments
 (0)