blob: 9f11d583fb36d6836af629b238c92328e680f133 [file] [log] [blame] [edit]
// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
package builder2v1
import (
"fmt"
"github.com/spdx/tools-golang/spdx/common"
"github.com/spdx/tools-golang/spdx/v2_1"
)
// BuildRelationshipSection2_1 creates an SPDX Relationship (version 2.1)
// solely for the document "DESCRIBES" package relationship, returning that
// relationship or error if any is encountered. Arguments:
// - packageName: name of package / directory
func BuildRelationshipSection2_1(packageName string) (*v2_1.Relationship, error) {
rln := &v2_1.Relationship{
RefA: common.MakeDocElementID("", "DOCUMENT"),
RefB: common.MakeDocElementID("", fmt.Sprintf("Package-%s", packageName)),
Relationship: "DESCRIBES",
}
return rln, nil
}