From 6d66012a0cc5f03239d13c9e1fce28bc28152003 Mon Sep 17 00:00:00 2001 From: James Hillyerd Date: Thu, 25 Jan 2024 10:06:35 -0800 Subject: [PATCH] Rename client.WithOptTransport (#464) * Update apiv1_client_opts.go * Update apiv1_client_test.go --- pkg/rest/client/apiv1_client_opts.go | 4 ++-- pkg/rest/client/apiv1_client_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/rest/client/apiv1_client_opts.go b/pkg/rest/client/apiv1_client_opts.go index 49fd67c..873db93 100644 --- a/pkg/rest/client/apiv1_client_opts.go +++ b/pkg/rest/client/apiv1_client_opts.go @@ -29,10 +29,10 @@ func (t transportOption) apply(opts *options) { opts.transport = t.transport } -// WithOptTransport sets the transport for the rest client. +// WithTransport sets the transport for the rest client. // Transport specifies the mechanism by which individual // HTTP requests are made. // If nil, http.DefaultTransport is used. -func WithOptTransport(transport http.RoundTripper) Option { +func WithTransport(transport http.RoundTripper) Option { return transportOption{transport} } diff --git a/pkg/rest/client/apiv1_client_test.go b/pkg/rest/client/apiv1_client_test.go index f7f84e2..3a40143 100644 --- a/pkg/rest/client/apiv1_client_test.go +++ b/pkg/rest/client/apiv1_client_test.go @@ -215,7 +215,7 @@ func TestClientV1GetMessageSource(t *testing.T) { func TestClientV1WithCustomTransport(t *testing.T) { // Call setup, passing a custom roundtripper and make sure it was used during the request. mockRoundTripper := &mockRoundTripper{ResponseBody: "Custom Transport"} - c, router, teardown := setup(client.WithOptTransport(mockRoundTripper)) + c, router, teardown := setup(client.WithTransport(mockRoundTripper)) defer teardown()