Less reports whether p sorts before q. Port identities sort first by clock identity, then their port numbers.
(q PortIdentity)
| 277 | // String formats PortIdentity same way ptp4l pmc client does |
| 278 | func (p PortIdentity) String() string { |
| 279 | return fmt.Sprintf("%s-%d", p.ClockIdentity, p.PortNumber) |
| 280 | } |
| 281 | |
| 282 | // Compare returns an integer comparing two port identities. The result will be 0 if p == q, -1 if p < q, and +1 if p > q. |