Skip to content

Commit

Permalink
Merge pull request #125 from swinslow/minor-fixes
Browse files Browse the repository at this point in the history
examples: Fix minor typos and wording
  • Loading branch information
swinslow committed Mar 31, 2022
2 parents 7e3a22c + df9da3f commit 83abf1a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
18 changes: 9 additions & 9 deletions examples/10-jsonloader/example_json_loader.go
Expand Up @@ -2,9 +2,9 @@

// Example for: *jsonparser2v2*

// This example demonstrates loading an SPDX json from disk into memory,
// and then logging out some attributes to the console .
// Run project: go run example_json_loader.go ../sample-docs/json/SPDXJSONExample-v2.2.spdx.json example.spdx
// This example demonstrates loading an SPDX JSON document from disk into memory,
// and then logging some of the attributes to the console.
// Run project: go run example_json_loader.go ../sample-docs/json/SPDXJSONExample-v2.2.spdx.json
package main

import (
Expand All @@ -19,10 +19,10 @@ func main() {

// check that we've received the right number of arguments
args := os.Args
if len(args) != 3 {
fmt.Printf("Usage: %v <json-file-in> <spdx-file-out>\n", args[0])
fmt.Printf(" Load SPDX 2.2 tag-value file <spdx-file-in>, and\n")
fmt.Printf(" save it out to <spdx-file-out>.\n")
if len(args) != 2 {
fmt.Printf("Usage: %v <json-file-in>\n", args[0])
fmt.Printf(" Load SPDX 2.2 JSON file <spdx-file-in>, and\n")
fmt.Printf(" print portions of its creation info data.\n")
return
}

Expand All @@ -49,7 +49,7 @@ func main() {
fmt.Println("Some Attributes of the Document:")
fmt.Printf("Document Name: %s\n", doc.CreationInfo.DocumentName)
fmt.Printf("DataLicense: %s\n", doc.CreationInfo.DataLicense)
fmt.Printf("Document NameSpace: %s\n", doc.CreationInfo.DocumentNamespace)
fmt.Printf("SPDX Document Version: %s\n", doc.CreationInfo.SPDXVersion)
fmt.Printf("Document Namespace: %s\n", doc.CreationInfo.DocumentNamespace)
fmt.Printf("SPDX Version: %s\n", doc.CreationInfo.SPDXVersion)
fmt.Println(strings.Repeat("=", 80))
}
2 changes: 1 addition & 1 deletion examples/3-build/example_build.go
Expand Up @@ -5,7 +5,7 @@
// This example demonstrates building an 'empty' SPDX document in memory that
// corresponds to a given directory's contents, including all files with their
// hashes and the package's verification code, and saving the document to disk.
// Run project: go run example_build.go project2 ../../testdata/project2 test.spdx
// Run project: go run example_build.go project2 ../../testdata/project2 test.spdx

package main

Expand Down
4 changes: 2 additions & 2 deletions examples/7-rdfloader/exampleRDFLoader.go
Expand Up @@ -42,7 +42,7 @@ func main() {
fmt.Println("Some Attributes of the Document:")
fmt.Printf("Document Name: %s\n", doc.CreationInfo.DocumentName)
fmt.Printf("DataLicense: %s\n", doc.CreationInfo.DataLicense)
fmt.Printf("Document NameSpace: %s\n", doc.CreationInfo.DocumentNamespace)
fmt.Printf("SPDX Document Version: %s\n", doc.CreationInfo.SPDXVersion)
fmt.Printf("Document Namespace: %s\n", doc.CreationInfo.DocumentNamespace)
fmt.Printf("SPDX Version: %s\n", doc.CreationInfo.SPDXVersion)
fmt.Println(strings.Repeat("=", 80))
}
16 changes: 9 additions & 7 deletions examples/README.md
Expand Up @@ -3,7 +3,8 @@ SPDX-License-Identifier: CC-BY-4.0
# tools-golang Examples

The `examples/` directory contains examples for how to use the various
tools-golang sub-packages.
tools-golang sub-packages. Sample commands below should be run from
within the example's subdirectory.

## 1-load/

Expand All @@ -19,15 +20,16 @@ and printing some of its contents to standard output.

This example demonstrates loading an SPDX tag-value file from disk into memory,
and re-saving it to a different file on disk.
#### Run project: *go run example_load_save.go ../sample-docs/example1/spdx/example1.spdx test.spdx*
#### Run project: *go run example_load_save.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx test.spdx*

## 3-build/

*builder*, *tvsaver*

This example demonstrates building an 'empty' SPDX document in memory that
corresponds to a given directory's contents, including all files with their
hashes and the package's verification code, and saving the document to disk.
#### Run project: *go run example_build.go project2 ../../testdata/project2 test.spdx*
#### Run project: *go run example_build.go project2 ../../testdata/project2 test.spdx*

## 4-search/

Expand All @@ -46,8 +48,8 @@ Package and File license fields; and saving the resulting document to disk.
This example demonstrates loading an SPDX tag-value file from disk into memory,
generating a basic report listing counts of the concluded licenses for its
files, and printing the report to standard output.
#### Run project: * go run example_report.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx
*
#### Run project: *go run example_report.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx*

## 6-licensediff

*licensediff*, *tvloader*
Expand All @@ -59,7 +61,7 @@ with matching IDs in each document.
This is generally only useful when run with two SPDX documents that describe
licenses for subsequent versions of the same set of files, AND if they have
the same identifier in both documents.
#### Run project *Run project: go run example_licensediff.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx ../sample-docs/example2/spdx/SPDXTagExample2-v2.2.spdx*
#### Run project: *go run example_licensediff.go ../sample-docs/example1/spdx/SPDXTagExample-v2.2.spdx ../sample-docs/example2/spdx/SPDXTagExample2-v2.2.spdx*

## 7-rdfloader

Expand Down Expand Up @@ -91,4 +93,4 @@ and then re-saving it to a different file on disk in json format.

This example demonstrates loading an SPDX json from disk into memory
and then logging some of the attributes to the console.
#### Run project: *go run example_json_loader.go ../sample-docs/json/SPDXJSONExample-v2.2.spdx.json example.spdx*
#### Run project: *go run example_json_loader.go ../sample-docs/json/SPDXJSONExample-v2.2.spdx.json*

0 comments on commit 83abf1a

Please sign in to comment.