Skip to content

Commit

Permalink
Merge pull request #2 from holyhope/client/factory
Browse files Browse the repository at this point in the history
feat(client) clients factories do not returns error
  • Loading branch information
holyhope authored Dec 29, 2023
2 parents 797c6ef + 0624d0a commit fed315a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v1/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fed315a

Please sign in to comment.