return history properly sorted

This commit is contained in:
anianz
2020-11-11 12:55:48 +01:00
parent cbbfd94fbb
commit df1fd83256
3 changed files with 15 additions and 5 deletions

View File

@@ -12,6 +12,12 @@ type JobVersion struct {
SubmitTime int
}
type History []JobVersion
func (h History) Len() int { return len(h) }
func (h History) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h History) Less(i, j int) bool { return h[i].Version < h[j].Version }
type Version struct {
Version int `json:"Version,string"`
}