~rbn/fit

ref: eab46d6d4412cad3bad4186d930993169b53d469 fit/item.go -rw-r--r-- 287 bytes View raw
eab46d6d — Ruben Schuller initial commit 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
package fit

type Item struct {
	Path string
	Size int64
}

type itemsBySize []Item

func (x itemsBySize) Len() int           { return len(x) }
func (x itemsBySize) Less(i, j int) bool { return x[i].Size < x[j].Size }
func (x itemsBySize) Swap(i, j int)      { x[i], x[j] = x[j], x[i] }