From 0a3b159ab87bd313896174f8464ffd277b14264c Mon Sep 17 00:00:00 2001 From: Song Juchao Date: Thu, 9 Apr 2020 09:47:55 +0800 Subject: [PATCH] Use error equals (#2636) --- persist/sqldb/workflow_archive.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/persist/sqldb/workflow_archive.go b/persist/sqldb/workflow_archive.go index 461126a40483..502cf8064f84 100644 --- a/persist/sqldb/workflow_archive.go +++ b/persist/sqldb/workflow_archive.go @@ -3,7 +3,6 @@ package sqldb import ( "context" "encoding/json" - "strings" "time" log "github.com/sirupsen/logrus" @@ -182,7 +181,7 @@ func (r *workflowArchive) GetWorkflow(uid string) (*wfv1.Workflow, error) { And(db.Cond{"uid": uid}). One(archivedWf) if err != nil { - if strings.Contains(err.Error(), "no more rows") { + if err == db.ErrNoMoreRows { return nil, nil } return nil, err