1// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 2 3package saver2v2 4 5import ( 6 "fmt" 7 "io" 8 9 "github.com/spdx/tools-golang/spdx/v2_2" 10) 11 12func renderOtherLicense2_2(ol *v2_2.OtherLicense, w io.Writer) error { 13 if ol.LicenseIdentifier != "" { 14 fmt.Fprintf(w, "LicenseID: %s\n", ol.LicenseIdentifier) 15 } 16 if ol.ExtractedText != "" { 17 fmt.Fprintf(w, "ExtractedText: %s\n", textify(ol.ExtractedText)) 18 } 19 if ol.LicenseName != "" { 20 fmt.Fprintf(w, "LicenseName: %s\n", ol.LicenseName) 21 } 22 for _, s := range ol.LicenseCrossReferences { 23 fmt.Fprintf(w, "LicenseCrossReference: %s\n", s) 24 } 25 if ol.LicenseComment != "" { 26 fmt.Fprintf(w, "LicenseComment: %s\n", textify(ol.LicenseComment)) 27 } 28 29 fmt.Fprintf(w, "\n") 30 31 return nil 32} 33