From e000236ecafdd60d20e642a2107557819de294a3 Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 12 Jul 2023 13:19:44 +0800 Subject: [PATCH] chore: use fmt.Errorf Sprint (#469) --- pkg/common/db/unrelation/extend_msg.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/common/db/unrelation/extend_msg.go b/pkg/common/db/unrelation/extend_msg.go index 17e0b2e19..6f09247bc 100644 --- a/pkg/common/db/unrelation/extend_msg.go +++ b/pkg/common/db/unrelation/extend_msg.go @@ -152,7 +152,7 @@ func (e *ExtendMsgSetMongoDriver) InsertOrUpdateReactionExtendMsgSet( return utils.Wrap(err, "") } if set == nil { - return errors.New(fmt.Sprintf("conversationID %s has no set", conversationID)) + return fmt.Errorf("conversationID %s has no set", conversationID) } _, err = e.ExtendMsgSetCollection.UpdateOne( ctx, @@ -181,7 +181,7 @@ func (e *ExtendMsgSetMongoDriver) DeleteReactionExtendMsgSet( return utils.Wrap(err, "") } if set == nil { - return errors.New(fmt.Sprintf("conversationID %s has no set", conversationID)) + return fmt.Errorf("conversationID %s has no set", conversationID) } _, err = e.ExtendMsgSetCollection.UpdateOne( ctx, @@ -226,5 +226,5 @@ func (e *ExtendMsgSetMongoDriver) TakeExtendMsg( if v, ok := setList[0].ExtendMsgs[clientMsgID]; ok { return &v, nil } - return nil, errors.New(fmt.Sprintf("cant find client msg id: %s", clientMsgID)) + return nil, fmt.Errorf("cant find client msg id: %s", clientMsgID) }