diff options
Diffstat (limited to 'builder/builder2v2/build_relationship.go')
-rw-r--r-- | builder/builder2v2/build_relationship.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/builder/builder2v2/build_relationship.go b/builder/builder2v2/build_relationship.go new file mode 100644 index 0000000..5eaf9de --- /dev/null +++ b/builder/builder2v2/build_relationship.go @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later + +package builder2v2 + +import ( + "fmt" + + "github.com/spdx/tools-golang/spdx" +) + +// BuildRelationshipSection2_2 creates an SPDX Relationship (version 2.2) +// solely for the document "DESCRIBES" package relationship, returning that +// relationship or error if any is encountered. Arguments: +// - packageName: name of package / directory +func BuildRelationshipSection2_2(packageName string) (*spdx.Relationship2_2, error) { + rln := &spdx.Relationship2_2{ + RefA: spdx.MakeDocElementID("", "DOCUMENT"), + RefB: spdx.MakeDocElementID("", fmt.Sprintf("Package-%s", packageName)), + Relationship: "DESCRIBES", + } + + return rln, nil +} |