From 62cf02e21a9cd3a791a43758dfab12448672f762 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 13 Mar 2014 15:08:59 -0600 Subject: Fix Tx.Buckets() sort order. @tv42 reported an issue with bucket names returning incorrectly. Not sure if this fixes the issue but it is necessary anyway. --- bucket.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bucket.go') diff --git a/bucket.go b/bucket.go index e1ad2a3..afc57fe 100644 --- a/bucket.go +++ b/bucket.go @@ -154,3 +154,9 @@ type BucketStat struct { KeyCount int MaxDepth int } + +type bucketsByName []*Bucket + +func (s bucketsByName) Len() int { return len(s) } +func (s bucketsByName) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s bucketsByName) Less(i, j int) bool { return s[i].name < s[j].name } -- cgit v1.2.3