From 839c373f2410a8d3827103c61b3c3b7e69a5f737 Mon Sep 17 00:00:00 2001 From: eatmoreapple Date: Wed, 25 Sep 2024 17:22:46 +0800 Subject: [PATCH] rename error --- errors.go | 4 ++-- message.go | 4 ++-- relations.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/errors.go b/errors.go index b41e01f..6a7f99b 100644 --- a/errors.go +++ b/errors.go @@ -27,8 +27,8 @@ var ( // NetworkErr define wechat network error NetworkErr = errors.New("wechat network error") - // ErrNoSuchUserFoundError define no such user found error - ErrNoSuchUserFoundError = errors.New("no such user found") + // ErrNoSuchUserFound define no such user found error + ErrNoSuchUserFound = errors.New("no such user found") // ErrLoginTimeout define login timeout error ErrLoginTimeout = errors.New("login timeout") diff --git a/message.go b/message.go index d795d8f..0a07445 100644 --- a/message.go +++ b/message.go @@ -131,7 +131,7 @@ func (m *Message) Receiver() (*User, error) { if err := group.Detail(); err == nil { return group, nil } - return nil, ErrNoSuchUserFoundError + return nil, ErrNoSuchUserFound } return users.First().User, nil } else { @@ -141,7 +141,7 @@ func (m *Message) Receiver() (*User, error) { } user, exist := members.GetByUserName(m.ToUserName) if !exist { - return nil, ErrNoSuchUserFoundError + return nil, ErrNoSuchUserFound } return user, nil } diff --git a/relations.go b/relations.go index 96dacb5..30be153 100644 --- a/relations.go +++ b/relations.go @@ -246,7 +246,7 @@ func (g *Group) SearchMemberByUsername(username string) (*User, error) { // 再次尝试获取 members = g.MemberList.SearchByUserName(1, username) if members.Count() == 0 { - return nil, ErrNoSuchUserFoundError + return nil, ErrNoSuchUserFound } return members.First(), nil }