refactor: add default client instance for contrib/sdk/httpclient (#2814)

This commit is contained in:
XG
2023-08-01 20:45:20 +08:00
committed by GitHub
parent 5230f8304e
commit c51785125e

View File

@ -32,8 +32,12 @@ type Client struct {
// New creates and returns a http client for SDK.
func New(config Config) *Client {
client := config.Client
if client == nil {
client = gclient.New()
}
return &Client{
Client: config.Client,
Client: client,
config: config,
}
}