File: element_ids.go

package info (click to toggle)
golang-github-spdx-tools-golang 0.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,252 kB
  • sloc: xml: 428; makefile: 22; ansic: 5; python: 2
file content (18 lines) | stat: -rw-r--r-- 364 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later

package spdxlib

import (
	"sort"

	"github.com/spdx/tools-golang/spdx/v2/common"
)

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

	return eIDs
}