diff options
author | Steve Winslow <steve@swinslow.net> | 2020-06-14 16:00:56 -0400 |
---|---|---|
committer | Steve Winslow <steve@swinslow.net> | 2020-06-14 16:00:56 -0400 |
commit | d1b825c0905735029cfa9b4d54057a350fe32d66 (patch) | |
tree | 6b398993765df4934fe21997a13a23f6150cd136 /examples/5-report | |
parent | 1e75edca9522aa82d1f269929d907209f93b3575 (diff) | |
download | spdx-tools-d1b825c0905735029cfa9b4d54057a350fe32d66.tar.gz |
Update examples to 2.2
Signed-off-by: Steve Winslow <steve@swinslow.net>
Diffstat (limited to 'examples/5-report')
-rw-r--r-- | examples/5-report/example_report.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/5-report/example_report.go b/examples/5-report/example_report.go index e4250be..4464f07 100644 --- a/examples/5-report/example_report.go +++ b/examples/5-report/example_report.go @@ -23,7 +23,7 @@ func main() { args := os.Args if len(args) != 2 { fmt.Printf("Usage: %v <spdx-file-in>\n", args[0]) - fmt.Printf(" Load SPDX 2.1 tag-value file <spdx-file-in>, and\n") + fmt.Printf(" Load SPDX 2.2 tag-value file <spdx-file-in>, and\n") fmt.Printf(" generate and print a report of its concluded licenses.\n") return } @@ -37,8 +37,8 @@ func main() { } defer r.Close() - // try to load the SPDX file's contents as a tag-value file, version 2.1 - doc, err := tvloader.Load2_1(r) + // try to load the SPDX file's contents as a tag-value file, version 2.2 + doc, err := tvloader.Load2_2(r) if err != nil { fmt.Printf("Error while parsing %v: %v", filename, err) return @@ -48,7 +48,7 @@ func main() { fmt.Printf("Successfully loaded %s\n\n", filename) // check whether the SPDX file has at least one package that it describes - pkgIDs, err := spdxlib.GetDescribedPackageIDs2_1(doc) + pkgIDs, err := spdxlib.GetDescribedPackageIDs2_2(doc) if err != nil { fmt.Printf("Unable to get describe packages from SPDX document: %v\n", err) return @@ -79,7 +79,7 @@ func main() { // values, sorted by # of occurrences fmt.Printf("============================\n") fmt.Printf("Package %s (%s)\n", string(pkgID), pkg.PackageName) - err = reporter.Generate(pkg, os.Stdout) + err = reporter.Generate2_2(pkg, os.Stdout) if err != nil { fmt.Printf("Error while generating report: %v\n", err) } |