mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-07 23:16:53 +00:00
CI/build: Update Go version, linters and fix minor issues (#1473)
* CI/build: Update Go version, linters and fix minor issues * Bump golangci-lint to v1.56.1 * BinanceUS: Make uint usage consistent * Throw blank identifiers into the trash
This commit is contained in:
@@ -141,21 +141,21 @@ func (s *GRPCServer) StartRPCRESTProxy() error {
|
||||
func (s *GRPCServer) authenticateClient(ctx context.Context) (context.Context, error) {
|
||||
md, ok := metadata.FromIncomingContext(ctx)
|
||||
if !ok {
|
||||
return ctx, fmt.Errorf("unable to extract metadata")
|
||||
return ctx, errors.New("unable to extract metadata")
|
||||
}
|
||||
|
||||
authStr, ok := md["authorization"]
|
||||
if !ok {
|
||||
return ctx, fmt.Errorf("authorization header missing")
|
||||
return ctx, errors.New("authorization header missing")
|
||||
}
|
||||
|
||||
if !strings.Contains(authStr[0], "Basic") {
|
||||
return ctx, fmt.Errorf("basic not found in authorization header")
|
||||
return ctx, errors.New("basic not found in authorization header")
|
||||
}
|
||||
|
||||
decoded, err := crypto.Base64Decode(strings.Split(authStr[0], " ")[1])
|
||||
if err != nil {
|
||||
return ctx, fmt.Errorf("unable to base64 decode authorization header")
|
||||
return ctx, errors.New("unable to base64 decode authorization header")
|
||||
}
|
||||
|
||||
creds := strings.Split(string(decoded), ":")
|
||||
@@ -164,7 +164,7 @@ func (s *GRPCServer) authenticateClient(ctx context.Context) (context.Context, e
|
||||
|
||||
if username != s.config.GRPC.Username ||
|
||||
password != s.config.GRPC.Password {
|
||||
return ctx, fmt.Errorf("username/password mismatch")
|
||||
return ctx, errors.New("username/password mismatch")
|
||||
}
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
@@ -858,7 +858,7 @@ func (bt *BackTest) loadData(cfg *config.Config, exch gctexchange.IBotExchange,
|
||||
return nil, err
|
||||
}
|
||||
if resp == nil {
|
||||
return nil, fmt.Errorf("processing error, response returned nil")
|
||||
return nil, errors.New("processing error, response returned nil")
|
||||
}
|
||||
|
||||
resp.Item.UnderlyingPair = underlyingPair
|
||||
|
||||
Reference in New Issue
Block a user