Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-04-15 21:58:19 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-04-19 09:51:32 +0300
commiteab58f4482dc44df126d8f67eecb1e475817549a (patch)
tree29ea68eda9eef76ad5caac933684db5923a01fc5 /auth
parentcf5b8f9ef470ad0d0b382c24c064e2facd268c49 (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.go3
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)
}