move container sort to struct method

This commit is contained in:
Bradley Cicenas
2017-06-12 13:40:52 +00:00
parent aff6943d07
commit a48a9031cc
4 changed files with 5 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ package container
import (
"fmt"
"regexp"
"sort"
"github.com/bcicen/ctop/config"
)
@@ -89,6 +90,7 @@ func SortFields() (fields []string) {
type Containers []*Container
func (a Containers) Sort() { sort.Sort(a) }
func (a Containers) Len() int { return len(a) }
func (a Containers) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a Containers) Less(i, j int) bool {