From 95de04112fce655e03426159a6a30d5db79f183d Mon Sep 17 00:00:00 2001 From: qydysky Date: Thu, 17 Jun 2021 15:17:35 +0800 Subject: [PATCH] fix --- CheckFile.go | 2 +- tmplKV/tmplKV.go | 2 +- tmplKV/tmplV.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CheckFile.go b/CheckFile.go index 9c28bc4..d35dad0 100644 --- a/CheckFile.go +++ b/CheckFile.go @@ -55,7 +55,7 @@ func (t *checkfile) IsExist(f string) bool { _, err := os.Stat(f) if err != nil { - if os.IsNotExist(err) { + if errors.Is(err, os.ErrNotExist) { t.RV = append(t.RV,false,nil) return false }else{ diff --git a/tmplKV/tmplKV.go b/tmplKV/tmplKV.go index 26008d5..3cbe132 100644 --- a/tmplKV/tmplKV.go +++ b/tmplKV/tmplKV.go @@ -71,7 +71,7 @@ func (s *tmplKV) GetV(key interface{}) (value interface{}){ //检查Key Value是否对应及有效 func (s *tmplKV) Check(key,value interface{}) bool { ok,v := s.Get(key) - return ok && v == value + return ok && (v == value) } //当前储存器键值数量 diff --git a/tmplKV/tmplV.go b/tmplKV/tmplV.go index 6cf2c4c..8213eab 100644 --- a/tmplKV/tmplV.go +++ b/tmplKV/tmplV.go @@ -89,7 +89,7 @@ func (s *tmplV) Get(key uintptr) (isLive bool,contect string){ func (s *tmplV) Check(key uintptr,contect string) bool { ok,k := s.Get(key) - return ok && k == contect + return ok && (k == contect) } func (s *tmplV) Buf() (int64,int) { -- 2.39.2