aboutsummaryrefslogtreecommitdiff
path: root/examples/3-build
diff options
context:
space:
mode:
authorSteve Winslow <steve@swinslow.net>2020-06-14 16:00:56 -0400
committerSteve Winslow <steve@swinslow.net>2020-06-14 16:00:56 -0400
commitd1b825c0905735029cfa9b4d54057a350fe32d66 (patch)
tree6b398993765df4934fe21997a13a23f6150cd136 /examples/3-build
parent1e75edca9522aa82d1f269929d907209f93b3575 (diff)
downloadspdx-tools-d1b825c0905735029cfa9b4d54057a350fe32d66.tar.gz
Update examples to 2.2
Signed-off-by: Steve Winslow <steve@swinslow.net>
Diffstat (limited to 'examples/3-build')
-rw-r--r--examples/3-build/example_build.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/3-build/example_build.go b/examples/3-build/example_build.go
index 64d6eb0..cc63bb7 100644
--- a/examples/3-build/example_build.go
+++ b/examples/3-build/example_build.go
@@ -22,7 +22,7 @@ func main() {
args := os.Args
if len(args) != 4 {
fmt.Printf("Usage: %v <package-name> <package-root-dir> <spdx-file-out>\n", args[0])
- fmt.Printf(" Build a SPDX 2.1 document with one package called <package-name>;\n")
+ fmt.Printf(" Build a SPDX 2.2 document with one package called <package-name>;\n")
fmt.Printf(" create files with hashes corresponding to the files in <package-root-dir>;\n")
fmt.Printf(" and save it out as a tag-value file to <spdx-file-out>.\n")
return
@@ -34,9 +34,9 @@ func main() {
fileOut := args[3]
// to use the SPDX builder package, the first step is to define a
- // builder.Config2_1 struct. this config data can be reused, in case you
+ // builder.Config2_2 struct. this config data can be reused, in case you
// are building SPDX documents for several directories in sequence.
- config := &builder.Config2_1{
+ config := &builder.Config2_2{
// NamespacePrefix is a prefix that will be used to populate the
// mandatory DocumentNamespace field in the Creation Info section.
@@ -86,7 +86,7 @@ func main() {
// - what to name the package; and
// - where the directory is located on disk; and
// - the config object we just defined.
- doc, err := builder.Build2_1(packageName, packageRootDir, config)
+ doc, err := builder.Build2_2(packageName, packageRootDir, config)
if err != nil {
fmt.Printf("Error while building document: %v\n", err)
return
@@ -107,7 +107,7 @@ func main() {
}
defer w.Close()
- err = tvsaver.Save2_1(doc, w)
+ err = tvsaver.Save2_2(doc, w)
if err != nil {
fmt.Printf("Error while saving %v: %v", fileOut, err)
return