From 91894a6f9659b0b0eb244203bbd0f3d61f759f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BE=B7=E6=BB=A1?= Date: Thu, 1 Apr 2021 20:17:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BB=E9=94=81=E9=87=8A?= =?UTF-8?q?=E6=94=BE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easylock/lock.go | 3 +-- util/string.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/easylock/lock.go b/easylock/lock.go index 25c5978..d096300 100644 --- a/easylock/lock.go +++ b/easylock/lock.go @@ -44,14 +44,13 @@ func (l *lock) Unlock(optionFuncList ...OptionFunc) error { func (l *lock) RLock(optionFuncList ...OptionFunc) error { defer l.AddRLockCnt(l.lockCnt) - l.sc.RLock() return nil } func (l *lock) RUnlock(optionFuncList ...OptionFunc) error { defer l.DecreaseRLockCnt(l.lockCnt) - l.sc.Unlock() + l.sc.RUnlock() return nil } diff --git a/util/string.go b/util/string.go index ae4cde5..c4b014a 100644 --- a/util/string.go +++ b/util/string.go @@ -43,6 +43,6 @@ func GenRandomString(source string, length uint) string { // Date : 6:01 下午 2021/3/9 func Md5(str string) string { h := md5.New() - h.Write([]byte(str)) + _, _ = h.Write([]byte(str)) return hex.EncodeToString(h.Sum(nil)) }