make tags of exported transaction data in the same order as they displayed in transaction

This commit is contained in:
MaysWind
2024-09-09 01:34:38 +08:00
parent 00c8259bd0
commit ee52db3f7c
3 changed files with 23 additions and 0 deletions
+9
View File
@@ -1,5 +1,7 @@
package utils
import "sort"
// Int64SliceEquals returns whether specific two int64 arrays equal
func Int64SliceEquals(s1, s2 []int64) bool {
if (s1 == nil) != (s2 == nil) {
@@ -58,6 +60,13 @@ func ToUniqueInt64Slice(items []int64) []int64 {
return uniqueItems
}
// Int64Sort sorts the specified array with int64 items
func Int64Sort(items []int64) {
sort.Slice(items, func(i, j int) bool {
return items[i] < items[j]
})
}
// ToSet returns a map where the keys are the items in the specified array
func ToSet(items []int64) map[int64]bool {
itemExistMap := make(map[int64]bool)