mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-03 23:16:53 +00:00
Bump golangci-lint to v1.24.0, linter fixes and general code improvements (#478)
* Bump golangci-lint version, update Go version deps and generic code improvements * Fix wesbocket resp nil check and zip closures * Update pprof path
This commit is contained in:
@@ -2,9 +2,9 @@ package crypto
|
||||
|
||||
import (
|
||||
"crypto/hmac"
|
||||
"crypto/md5" // nolint:gosec
|
||||
"crypto/md5" // nolint // Used by some exchanges
|
||||
"crypto/rand"
|
||||
"crypto/sha1" // nolint:gosec
|
||||
"crypto/sha1" // nolint // Used by some exchanges
|
||||
"crypto/sha256"
|
||||
"crypto/sha512"
|
||||
"encoding/base64"
|
||||
@@ -62,7 +62,7 @@ func GetRandomSalt(input []byte, saltLen int) ([]byte, error) {
|
||||
|
||||
// GetMD5 returns a MD5 hash of a byte array
|
||||
func GetMD5(input []byte) []byte {
|
||||
m := md5.New() // nolint:gosec
|
||||
m := md5.New() // nolint // Used by some exchanges
|
||||
m.Write(input)
|
||||
return m.Sum(nil)
|
||||
}
|
||||
@@ -107,7 +107,7 @@ func GetHMAC(hashType int, input, key []byte) []byte {
|
||||
// Sha1ToHex takes a string, sha1 hashes it and return a hex string of the
|
||||
// result
|
||||
func Sha1ToHex(data string) string {
|
||||
h := sha1.New() // nolint:gosec
|
||||
h := sha1.New() // nolint // Used by some exchanges
|
||||
h.Write([]byte(data))
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user