From 0624d0a0dd59aa368ae6734abd879ae83d49fe89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20P=C3=89RONNET?= Date: Fri, 29 Dec 2023 21:09:05 +0100 Subject: [PATCH] feat(client) clients factories do not returns error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre PÉRONNET --- v1/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v1/client.go b/v1/client.go index 203178c..4f10e87 100644 --- a/v1/client.go +++ b/v1/client.go @@ -27,17 +27,17 @@ type Client struct { } // NewClient creates a new Digiposte client. -func NewClient(client *http.Client) (*Client, error) { +func NewClient(client *http.Client) *Client { return NewCustomClient(DefaultAPIURL, DefaultDocumentURL, client) } // NewClient creates a new Digiposte client. -func NewCustomClient(apiURL, documentURL string, client *http.Client) (*Client, error) { +func NewCustomClient(apiURL, documentURL string, client *http.Client) *Client { return &Client{ apiURL: strings.TrimRight(apiURL, "/"), documentURL: strings.TrimRight(documentURL, "/"), client: client, - }, nil + } } func (c *Client) apiRequest(ctx context.Context, method string, path string, body io.Reader) (*http.Request, error) {