mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-01-19 06:53:32 +08:00
sort tags by key (#4047)
Signed-off-by: changlin.shi <changlin.shi@ly.com> Signed-off-by: changlin.shi <changlin.shi@ly.com>
This commit is contained in:
parent
438146249f
commit
bb289d7d69
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"github.com/seaweedfs/seaweedfs/weed/util"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -39,6 +40,11 @@ func FromTags(tags map[string]string) (t *Tagging) {
|
||||
Value: v,
|
||||
})
|
||||
}
|
||||
if tagArr := t.TagSet.Tag; len(tagArr) > 0 {
|
||||
sort.SliceStable(tagArr, func(i, j int) bool {
|
||||
return tagArr[i].Key < tagArr[j].Key
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user