0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2024-12-30 22:34:18 -05:00

add more golangci-lint checks

This commit is contained in:
Will Norris 2020-09-10 00:30:25 -07:00
parent 80c7cb29a6
commit 067500cd7d
2 changed files with 20 additions and 2 deletions

View file

@ -1,6 +1,24 @@
linters: linters:
enable: enable:
- dogsled
- dupl
- goimports - goimports
- stylecheck - gosec
- misspell - misspell
- nakedret
- stylecheck
- unconvert
- unparam
- whitespace - whitespace
issues:
exclude-rules:
# Some cache implementations use md5 hashes for cached filenames. There is
# a slight risk of cache poisoning if an attacker could construct a URL
# with the same hash, but it would also need to be allowed by the proxies
# security settings. Changing these to a more secure hash algorithm would
# result in 100% cache misses when users upgrade. For now, just leave these
# alone.
- path: internal/.*cache
linters: gosec
text: G(401|501)

View file

@ -53,7 +53,7 @@ func sign(key string, s string, urlOnly bool) ([]byte, error) {
return nil, fmt.Errorf("error parsing key: %v", err) return nil, fmt.Errorf("error parsing key: %v", err)
} }
mac := hmac.New(sha256.New, []byte(k)) mac := hmac.New(sha256.New, k)
if _, err := mac.Write([]byte(u.String())); err != nil { if _, err := mac.Write([]byte(u.String())); err != nil {
return nil, err return nil, err
} }