mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-01 15:52:41 +02:00
fix go lint warnings
- handle errors where possible - explicitly ignore errors where it makes sense to - fix deprecations and unused var
This commit is contained in:
parent
5600290c82
commit
fc79b851b2
7 changed files with 31 additions and 19 deletions
|
|
@ -54,7 +54,9 @@ func sign(key string, s string, urlOnly bool) ([]byte, error) {
|
|||
}
|
||||
|
||||
mac := hmac.New(sha256.New, []byte(k))
|
||||
mac.Write([]byte(u.String()))
|
||||
if _, err := mac.Write([]byte(u.String())); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return mac.Sum(nil), nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ var signatureKeys signatureKeyList
|
|||
var scaleUp = flag.Bool("scaleUp", false, "allow images to scale beyond their original dimensions")
|
||||
var timeout = flag.Duration("timeout", 0, "time limit for requests served by this proxy")
|
||||
var verbose = flag.Bool("verbose", false, "print verbose logging messages")
|
||||
var version = flag.Bool("version", false, "Deprecated: this flag does nothing")
|
||||
var _ = flag.Bool("version", false, "Deprecated: this flag does nothing")
|
||||
var contentTypes = flag.String("contentTypes", "image/*", "comma separated list of allowed content types")
|
||||
var userAgent = flag.String("userAgent", "willnorris/imageproxy", "specify the user-agent used by imageproxy when fetching images from origin website")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue