aboutsummaryrefslogtreecommitdiff
path: root/spdxlib/relationships.go
diff options
context:
space:
mode:
authorBrandon Lum <lumjjb@gmail.com>2022-07-19 16:43:48 -0400
committerBrandon Lum <lumjjb@gmail.com>2022-07-19 22:43:24 -0400
commit9ae1bd2f8e0dabb0845f1225b54f23e8f3a429f1 (patch)
treea43213aadfb9bde3d9ec15634a39305f19ff38b2 /spdxlib/relationships.go
parent41d2272711255f5a25e16e3507ec3318bc550189 (diff)
downloadspdx-tools-9ae1bd2f8e0dabb0845f1225b54f23e8f3a429f1.tar.gz
replace all v2_1, v2_2 with new convention
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
Diffstat (limited to 'spdxlib/relationships.go')
-rw-r--r--spdxlib/relationships.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/spdxlib/relationships.go b/spdxlib/relationships.go
index ecc5a19..5ff4197 100644
--- a/spdxlib/relationships.go
+++ b/spdxlib/relationships.go
@@ -2,12 +2,16 @@
package spdxlib
-import "github.com/spdx/tools-golang/spdx"
+import (
+ "github.com/spdx/tools-golang/spdx/common"
+ "github.com/spdx/tools-golang/spdx/v2_1"
+ "github.com/spdx/tools-golang/spdx/v2_2"
+)
// FilterRelationships2_1 returns a slice of Element IDs returned by the given filter closure. The closure is passed
// one relationship at a time, and it can return an ElementID or nil.
-func FilterRelationships2_1(doc *spdx.Document2_1, filter func(*spdx.Relationship2_1) *spdx.ElementID) ([]spdx.ElementID, error) {
- elementIDs := []spdx.ElementID{}
+func FilterRelationships2_1(doc *v2_1.Document, filter func(*v2_1.Relationship) *common.ElementID) ([]common.ElementID, error) {
+ elementIDs := []common.ElementID{}
for _, relationship := range doc.Relationships {
if id := filter(relationship); id != nil {
@@ -20,8 +24,8 @@ func FilterRelationships2_1(doc *spdx.Document2_1, filter func(*spdx.Relationshi
// FilterRelationships2_2 returns a slice of Element IDs returned by the given filter closure. The closure is passed
// one relationship at a time, and it can return an ElementID or nil.
-func FilterRelationships2_2(doc *spdx.Document2_2, filter func(*spdx.Relationship2_2) *spdx.ElementID) ([]spdx.ElementID, error) {
- elementIDs := []spdx.ElementID{}
+func FilterRelationships2_2(doc *v2_2.Document, filter func(*v2_2.Relationship) *common.ElementID) ([]common.ElementID, error) {
+ elementIDs := []common.ElementID{}
for _, relationship := range doc.Relationships {
if id := filter(relationship); id != nil {