aboutsummaryrefslogtreecommitdiff
path: root/internal/tool
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-03-21 13:39:32 +0800
committerGitHub <noreply@github.com>2020-03-21 13:39:32 +0800
commit5843038a0812cc133c1895b7410aeda7153e8708 (patch)
tree3515998242443e1a82217ee4702603819c5315c8 /internal/tool
parent958d8b6bb4c2da66859325695b91d871e567a4fa (diff)
workflows: enable golangci-lint (#5998)
* Create golint.yml * Update golint.yml * Update golint.yml * Fix errcheck * Fix gosimple * Fix staticcheck
Diffstat (limited to 'internal/tool')
-rw-r--r--internal/tool/tool.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/tool/tool.go b/internal/tool/tool.go
index 2410b4d6..380f1069 100644
--- a/internal/tool/tool.go
+++ b/internal/tool/tool.go
@@ -30,7 +30,7 @@ import (
// MD5Bytes encodes string to MD5 bytes.
func MD5Bytes(str string) []byte {
m := md5.New()
- m.Write([]byte(str))
+ _, _ = m.Write([]byte(str))
return m.Sum(nil)
}
@@ -42,7 +42,7 @@ func MD5(str string) string {
// SHA1 encodes string to SHA1 hex value.
func SHA1(str string) string {
h := sha1.New()
- h.Write([]byte(str))
+ _, _ = h.Write([]byte(str))
return hex.EncodeToString(h.Sum(nil))
}
@@ -182,7 +182,7 @@ func CreateTimeLimitCode(data string, minutes int, startInf interface{}) string
func HashEmail(email string) string {
email = strings.ToLower(strings.TrimSpace(email))
h := md5.New()
- h.Write([]byte(email))
+ _, _ = h.Write([]byte(email))
return hex.EncodeToString(h.Sum(nil))
}