From bd1f33dceda76b4bc2ff1d7f9f40375d628d8e17 Mon Sep 17 00:00:00 2001 From: SoXX Date: Mon, 23 Oct 2023 10:29:27 +0200 Subject: [PATCH] refactor: moved http.Client to model.RequestContext Signed-off-by: SoXX --- pkg/e621/endpoints/tag.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/e621/endpoints/tag.go b/pkg/e621/endpoints/tag.go index ed384b4..293c644 100644 --- a/pkg/e621/endpoints/tag.go +++ b/pkg/e621/endpoints/tag.go @@ -80,7 +80,7 @@ func GetTag(requestContext model.RequestContext, ID string) (model.Tag, error) { // Returns: // - []model.Tag: A slice of tags. // - error: An error, if any, encountered during the API request or response handling. -func GetTags(client http.Client, requestContext model.RequestContext, query map[string]string) ([]model.Tag, error) { +func GetTags(requestContext model.RequestContext, query map[string]string) ([]model.Tag, error) { // Create a new HTTP GET request. r, err := http.NewRequest("GET", fmt.Sprintf("%s/tags.json", requestContext.Host), nil) if err != nil { @@ -99,7 +99,7 @@ func GetTags(client http.Client, requestContext model.RequestContext, query map[ r.SetBasicAuth(requestContext.Username, requestContext.APIKey) // Send the request using the provided http.Client. - resp, err := client.Do(r) + resp, err := requestContext.Client.Do(r) if err != nil { log.Print(err) }