mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-01 23:16:51 +00:00
exchanges/refactor: Use strings.Builder for string construction (#2046)
* refactor: use strings.builder Signed-off-by: keeghcet <keeghcet@outlook.com> * Apply suggestion from @shazbert Co-authored-by: Ryan O'Hara-Reid <oharareid.ryan@gmail.com> --------- Signed-off-by: keeghcet <keeghcet@outlook.com> Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> Co-authored-by: Ryan O'Hara-Reid <oharareid.ryan@gmail.com>
This commit is contained in:
@@ -2593,16 +2593,16 @@ func (e *Exchange) SendAuthHTTPRequestV5(ctx context.Context, ePath exchange.URL
|
||||
return fmt.Errorf("%w code: %d message: %s", request.ErrAuthRequestFailed, response.RetCode, response.RetMsg)
|
||||
}
|
||||
if len(response.RetExtInfo.List) > 0 && response.RetCode != 0 {
|
||||
var errMessage string
|
||||
var errMessage strings.Builder
|
||||
var failed bool
|
||||
for i := range response.RetExtInfo.List {
|
||||
if response.RetExtInfo.List[i].Code != 0 {
|
||||
failed = true
|
||||
errMessage += fmt.Sprintf("code: %d message: %s ", response.RetExtInfo.List[i].Code, response.RetExtInfo.List[i].Message)
|
||||
errMessage.WriteString(fmt.Sprintf("code: %d message: %s ", response.RetExtInfo.List[i].Code, response.RetExtInfo.List[i].Message))
|
||||
}
|
||||
}
|
||||
if failed {
|
||||
return fmt.Errorf("%w %s", request.ErrAuthRequestFailed, errMessage)
|
||||
return fmt.Errorf("%w %s", request.ErrAuthRequestFailed, errMessage.String())
|
||||
}
|
||||
}
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user