diff options
Diffstat (limited to 'tvsaver/saver2v1/save_annotation.go')
-rw-r--r-- | tvsaver/saver2v1/save_annotation.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tvsaver/saver2v1/save_annotation.go b/tvsaver/saver2v1/save_annotation.go new file mode 100644 index 0000000..f46ed4a --- /dev/null +++ b/tvsaver/saver2v1/save_annotation.go @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later + +package saver2v1 + +import ( + "fmt" + "io" + + "github.com/spdx/tools-golang/spdx" +) + +func renderAnnotation2_1(ann *spdx.Annotation2_1, w io.Writer) error { + if ann.Annotator != "" && ann.AnnotatorType != "" { + fmt.Fprintf(w, "Annotator: %s: %s\n", ann.AnnotatorType, ann.Annotator) + } + if ann.AnnotationDate != "" { + fmt.Fprintf(w, "AnnotationDate: %s\n", ann.AnnotationDate) + } + if ann.AnnotationType != "" { + fmt.Fprintf(w, "AnnotationType: %s\n", ann.AnnotationType) + } + if ann.AnnotationSPDXIdentifier != "" { + fmt.Fprintf(w, "SPDXREF: %s\n", ann.AnnotationSPDXIdentifier) + } + if ann.AnnotationComment != "" { + fmt.Fprintf(w, "AnnotationComment: %s\n", textify(ann.AnnotationComment)) + } + + return nil +} |