Skip to content

Commit 20f5963

Browse files
committed
remove pointer argument and error
Signed-off-by: Enrique Lacal <[email protected]>
1 parent fe6e22d commit 20f5963

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/ffresty/ffresty.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,21 @@ func New(ctx context.Context, staticConfig config.Section) (client *resty.Client
9696
return nil, err
9797
}
9898

99-
return NewWithConfig(ctx, ffrestyConfig)
99+
return NewWithConfig(ctx, *ffrestyConfig), nil
100100
}
101101

102102
// New creates a new Resty client, using static configuration (from the config file)
103103
// from a given section in the static configuration
104104
//
105105
// You can use the normal Resty builder pattern, to set per-instance configuration
106106
// as required.
107-
func NewWithConfig(ctx context.Context, ffrestyConfig *Config) (client *resty.Client, err error) {
108-
// passthroughHeadersEnabled := staticConfig.GetBool(HTTPPassthroughHeadersEnabled)
109-
107+
func NewWithConfig(ctx context.Context, ffrestyConfig Config) (client *resty.Client) {
110108
if ffrestyConfig.HTTPCustomClient != nil {
111109
if httpClient, ok := ffrestyConfig.HTTPCustomClient.(*http.Client); ok {
112110
client = resty.NewWithClient(httpClient)
113111
}
114112
}
113+
115114
if client == nil {
116115

117116
httpTransport := &http.Transport{
@@ -219,7 +218,7 @@ func NewWithConfig(ctx context.Context, ffrestyConfig *Config) (client *resty.Cl
219218
})
220219
}
221220

222-
return client, nil
221+
return client
223222
}
224223

225224
func WrapRestErr(ctx context.Context, res *resty.Response, err error, key i18n.ErrorMessageKey) error {

0 commit comments

Comments
 (0)