From 337725c35424b1b039448eec671677e11ee4b67e Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 6 Mar 2020 23:22:10 +0100 Subject: [PATCH] Use sort.Strings --- cmd/restic/cmd_diff.go | 2 +- internal/restic/snapshot_group.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/restic/cmd_diff.go b/cmd/restic/cmd_diff.go index b2ce7fca0..090568845 100644 --- a/cmd/restic/cmd_diff.go +++ b/cmd/restic/cmd_diff.go @@ -196,7 +196,7 @@ func uniqueNodeNames(tree1, tree2 *restic.Tree) (tree1Nodes, tree2Nodes map[stri uniqueNames = append(uniqueNames, name) } - sort.Sort(sort.StringSlice(uniqueNames)) + sort.Strings(uniqueNames) return tree1Nodes, tree2Nodes, uniqueNames } diff --git a/internal/restic/snapshot_group.go b/internal/restic/snapshot_group.go index 1e5ac18ee..bc3ef8ae3 100644 --- a/internal/restic/snapshot_group.go +++ b/internal/restic/snapshot_group.go @@ -51,7 +51,7 @@ func GroupSnapshots(snapshots Snapshots, options string) (map[string]Snapshots, if GroupByTag { tags = sn.Tags - sort.StringSlice(tags).Sort() + sort.Strings(tags) } if GroupByHost { hostname = sn.Hostname @@ -60,7 +60,7 @@ func GroupSnapshots(snapshots Snapshots, options string) (map[string]Snapshots, paths = sn.Paths } - sort.StringSlice(sn.Paths).Sort() + sort.Strings(sn.Paths) var k []byte var err error