Skip to content

Commit

Permalink
rename error
Browse files Browse the repository at this point in the history
  • Loading branch information
eatmoreapple committed Sep 25, 2024
1 parent 45ce4ad commit 839c373
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion relations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 839c373

Please sign in to comment.