1// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 2 3package saver2v3 4 5import ( 6 "fmt" 7 "io" 8 9 "github.com/spdx/tools-golang/spdx/common" 10 "github.com/spdx/tools-golang/spdx/v2_3" 11) 12 13func renderRelationship2_3(rln *v2_3.Relationship, w io.Writer) error { 14 rlnAStr := common.RenderDocElementID(rln.RefA) 15 rlnBStr := common.RenderDocElementID(rln.RefB) 16 if rlnAStr != "SPDXRef-" && rlnBStr != "SPDXRef-" && rln.Relationship != "" { 17 fmt.Fprintf(w, "Relationship: %s %s %s\n", rlnAStr, rln.Relationship, rlnBStr) 18 } 19 if rln.RelationshipComment != "" { 20 fmt.Fprintf(w, "RelationshipComment: %s\n", textify(rln.RelationshipComment)) 21 } 22 23 return nil 24} 25