package sentio import ( "cmp" "time" ) type PortfolioRecord struct { TS time.Time Equity float64 PnL float64 PnLPct float64 } func ComparePortfolioRecords(a, b PortfolioRecord) int { return cmp.Compare(a.TS.Unix(), b.TS.Unix()) }