(other Post)
| 54 | } |
| 55 | |
| 56 | func (p Post) Compare(other Post) int { |
| 57 | if p.PublishDate.Before(other.PublishDate) { |
| 58 | return -1 |
| 59 | } else if p.PublishDate.After(other.PublishDate) { |
| 60 | return 1 |
| 61 | } |
| 62 | return 0 |
| 63 | } |
| 64 | |
| 65 | func (p Post) Equal(other Post) bool { |
| 66 | return p.Compare(other) == 0 |