MCPcopy Index your code
hub / github.com/expr-lang/expr / Compare

Method Compare

test/playground/env.go:56–63  ·  view source on GitHub ↗
(other Post)

Source from the content-addressed store, hash-verified

54}
55
56func (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
65func (p Post) Equal(other Post) bool {
66 return p.Compare(other) == 0

Callers 2

EqualMethod · 0.95
compareFunction · 0.80

Calls 2

BeforeMethod · 0.80
AfterMethod · 0.80

Tested by

no test coverage detected