[#381] zfs: ListFilesystemVersions: make list filesystems version invocation deterministic

fixes #381
ref #379
This commit is contained in:
Christian Schwarz 2020-11-01 13:59:21 +01:00
parent 0a2dea05a9
commit c420f3c909

View File

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"context" "context"
"fmt" "fmt"
"sort"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
@ -40,6 +41,7 @@ func (s VersionTypeSet) zfsListTFlagRepr() string {
for t := range s { for t := range s {
types = append(types, t.String()) types = append(types, t.String())
} }
sort.StringSlice(types).Sort()
return strings.Join(types, ",") return strings.Join(types, ",")
} }
func (s VersionTypeSet) String() string { return s.zfsListTFlagRepr() } func (s VersionTypeSet) String() string { return s.zfsListTFlagRepr() }