aboutsummaryrefslogtreecommitdiff
path: root/spdxlib/element_ids.go
blob: 2214d04e916b9255eab980751bf77f7945801832 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package spdxlib

import (
    "github.com/spdx/tools-golang/spdx"
    "sort"
)

// SortElementIDs sorts and returns the given slice of ElementIDs
func SortElementIDs(eIDs []spdx.ElementID) []spdx.ElementID {
    sort.Slice(eIDs, func(i, j int) bool {
        return eIDs[i] < eIDs[j]
    })

    return eIDs
}