From 494d58bf2ced3f96442c5a6facfa6d9abb1c0318 Mon Sep 17 00:00:00 2001 From: "E. Lynette Rayle" Date: Mon, 17 Jun 2024 16:59:04 -0400 Subject: [PATCH 1/4] add notification of generated code --- cmd/exceptions.go | 4 ++++ cmd/license.go | 8 ++++++++ spdxexp/spdxlicenses/get_deprecated.go | 4 ++++ spdxexp/spdxlicenses/get_exceptions.go | 4 ++++ spdxexp/spdxlicenses/get_licenses.go | 4 ++++ 5 files changed, 24 insertions(+) diff --git a/cmd/exceptions.go b/cmd/exceptions.go index 04c93a4..749bf5d 100644 --- a/cmd/exceptions.go +++ b/cmd/exceptions.go @@ -51,6 +51,10 @@ func extractExceptionLicenseIDs() error { // generate the GetExceptions() function in get_exceptions.go getExceptionsContents := []byte(`package spdxlicenses +// Code generated by go-spdx cmd/exceptions.go. DO NOT EDIT. +// Source: https://github.com/spdx/license-list-data specifies official SPDX license list. + +// GetExceptions returns a slice of exception license IDs. func GetExceptions() []string { return []string{ `) diff --git a/cmd/license.go b/cmd/license.go index ca15e40..c051189 100644 --- a/cmd/license.go +++ b/cmd/license.go @@ -56,6 +56,10 @@ func extractLicenseIDs() error { // generate the GetLicenses() function in get_licenses.go getLicensesContents := []byte(`package spdxlicenses +// Code generated by go-spdx cmd/license.go. DO NOT EDIT. +// Source: https://github.com/spdx/license-list-data specifies official SPDX license list. + +// GetLicenses returns a slice of active license IDs. func GetLicenses() []string { return []string{ `) @@ -76,6 +80,10 @@ func GetLicenses() []string { // generate the GetDeprecated() function in get_deprecated.go getDeprecatedContents := []byte(`package spdxlicenses +// Code generated by go-spdx cmd/license.go. DO NOT EDIT. +// Source: https://github.com/spdx/license-list-data specifies official SPDX license list. + +// GetDeprecated returns a slice of deprecated license IDs. func GetDeprecated() []string { return []string{ `) diff --git a/spdxexp/spdxlicenses/get_deprecated.go b/spdxexp/spdxlicenses/get_deprecated.go index d0776a5..bef76dd 100644 --- a/spdxexp/spdxlicenses/get_deprecated.go +++ b/spdxexp/spdxlicenses/get_deprecated.go @@ -1,5 +1,9 @@ package spdxlicenses +// Code generated by go-spdx cmd/license.go. DO NOT EDIT. +// Source: https://github.com/spdx/license-list-data specifies official SPDX license list. + +// GetDeprecated returns a slice of deprecated license IDs. func GetDeprecated() []string { return []string{ "AGPL-1.0", diff --git a/spdxexp/spdxlicenses/get_exceptions.go b/spdxexp/spdxlicenses/get_exceptions.go index 0532ce6..cc55f2c 100644 --- a/spdxexp/spdxlicenses/get_exceptions.go +++ b/spdxexp/spdxlicenses/get_exceptions.go @@ -1,5 +1,9 @@ package spdxlicenses +// Code generated by go-spdx cmd/exceptions.go. DO NOT EDIT. +// Source: https://github.com/spdx/license-list-data specifies official SPDX license list. + +// GetExceptions returns a slice of exception license IDs. func GetExceptions() []string { return []string{ "389-exception", diff --git a/spdxexp/spdxlicenses/get_licenses.go b/spdxexp/spdxlicenses/get_licenses.go index 1f402ab..6675879 100644 --- a/spdxexp/spdxlicenses/get_licenses.go +++ b/spdxexp/spdxlicenses/get_licenses.go @@ -1,5 +1,9 @@ package spdxlicenses +// Code generated by go-spdx cmd/license.go. DO NOT EDIT. +// Source: https://github.com/spdx/license-list-data specifies official SPDX license list. + +// GetLicenses returns a slice of active license IDs. func GetLicenses() []string { return []string{ "0BSD", From 80b9f6be468ed7f98176f43945f7a140d3674b3a Mon Sep 17 00:00:00 2001 From: "E. Lynette Rayle" Date: Mon, 17 Jun 2024 16:59:15 -0400 Subject: [PATCH 2/4] add package docs for spdxlicenses --- spdxexp/spdxlicenses/doc.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 spdxexp/spdxlicenses/doc.go diff --git a/spdxexp/spdxlicenses/doc.go b/spdxexp/spdxlicenses/doc.go new file mode 100644 index 0000000..81d3860 --- /dev/null +++ b/spdxexp/spdxlicenses/doc.go @@ -0,0 +1,9 @@ +/* +Spdxlicenses package provides functions to get licenses, deprecated licenses, and exceptions. These are auto-generated and should not be modified directly. +Licenses are generated from the [SPDX official machine readable license list]. + +In addition, this package includes a function to return license ranges for sequential licenses and ranges including modifiers (i.e. -only, -or-later). + +[SPDX official machine readable license list]: https://github.com/spdx/license-list-data +*/ +package spdxlicenses From 978d517ac95775de37521dd896d6974ddee2f290 Mon Sep 17 00:00:00 2001 From: "E. Lynette Rayle" Date: Mon, 17 Jun 2024 16:59:35 -0400 Subject: [PATCH 3/4] update to Go 1.22 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4389fc0..e353dcc 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/github/go-spdx/v2 -go 1.18 +go 1.22 require github.com/stretchr/testify v1.8.0 From 073766030d4c9e98960264a633b23696ef066057 Mon Sep 17 00:00:00 2001 From: "E. Lynette Rayle" Date: Mon, 17 Jun 2024 17:02:36 -0400 Subject: [PATCH 4/4] update Go references in README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 093b1a4..10bc43a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Go Reference](https://pkg.go.dev/badge/github.com/github/go-spdx/v2@v2.1.2/spdxexp.svg)](https://pkg.go.dev/github.com/github/go-spdx/v2@v2.1.2/spdxexp) +[![Go Reference](https://pkg.go.dev/badge/github.com/github/go-spdx/v2@v2.3.0/spdxexp.svg)](https://pkg.go.dev/github.com/github/go-spdx/v2@v2.3.0/spdxexp) +[![Go Reference](https://pkg.go.dev/badge/github.com/github/go-spdx/v2@v2.3.0/spdxlicenses.svg)](https://pkg.go.dev/github.com/github/go-spdx/v2@v2.3.0/spdxlicenses) # go-spdx