diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-04-15 21:58:19 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-04-19 09:51:32 +0300 |
commit | eab58f4482dc44df126d8f67eecb1e475817549a (patch) | |
tree | 29ea68eda9eef76ad5caac933684db5923a01fc5 /auth | |
parent | cf5b8f9ef470ad0d0b382c24c064e2facd268c49 (diff) |
global: Do not ignore write errors
We're currently missing error checks for various invocations of
`Write()` functions. Fix this issue by properly checking returned errors
and drop the corresponding linter ignore rule.
Diffstat (limited to 'auth')
-rw-r--r-- | auth/token.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/auth/token.go b/auth/token.go index fa9ab584e..566557f9c 100644 --- a/auth/token.go +++ b/auth/token.go @@ -138,7 +138,8 @@ func v2HmacInfoValid(message string, signedMessage, secret []byte, targetTime ti func hmacSign(secret []byte, message string) []byte { mac := hmac.New(sha256.New, secret) - mac.Write([]byte(message)) + // hash.Hash never returns an error. + _, _ = mac.Write([]byte(message)) return mac.Sum(nil) } |