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:
Adrian Gallagher
2020-04-09 13:07:32 +10:00
committed by GitHub
parent 4748a7849c
commit 0d787bc259
47 changed files with 193 additions and 178 deletions

View File

@@ -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))
}