implement fmt.Stringer
()
| 57 | |
| 58 | // implement fmt.Stringer |
| 59 | func (u *User) String() string { |
| 60 | format := "User" |
| 61 | if u.IsSelf() { |
| 62 | format = "Self" |
| 63 | } else if u.IsFriend() { |
| 64 | format = "Friend" |
| 65 | } else if u.IsGroup() { |
| 66 | format = "Group" |
| 67 | } else if u.IsMP() { |
| 68 | format = "MP" |
| 69 | } |
| 70 | return fmt.Sprintf("<%s:%s>", format, u.NickName) |
| 71 | } |
| 72 | |
| 73 | // GetAvatarResponse 获取用户头像 |
| 74 | func (u *User) GetAvatarResponse() (resp *http.Response, err error) { |