spdxlicenses

package
v2.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package spdxlicenses 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).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDeprecated

func GetDeprecated() []string

GetDeprecated returns a slice of deprecated license IDs.

func GetDeprecatedMap added in v2.6.0

func GetDeprecatedMap() map[string]string

GetDeprecatedMap returns a map of deprecated license IDs keyed by uppercase ID.

func GetExceptions

func GetExceptions() []string

GetExceptions returns a slice of exception license IDs.

func GetExceptionsMap added in v2.6.0

func GetExceptionsMap() map[string]string

GetExceptionsMap returns a map of exception license IDs keyed by uppercase ID.

func GetLicenses

func GetLicenses() []string

GetLicenses returns a slice of active license IDs.

func GetLicensesMap added in v2.6.0

func GetLicensesMap() map[string]string

GetLicensesMap returns a map of active license IDs keyed by uppercase ID.

func IsActiveLicense added in v2.6.0

func IsActiveLicense(id string) (bool, string)

IsActiveLicense does a case-insensitive lookup for the license id in the active licenses map. It returns true and the case-sensitive ID if found, otherwise false and the original id.

func IsDeprecatedLicense added in v2.6.0

func IsDeprecatedLicense(id string) (bool, string)

IsDeprecatedLicense does a case-insensitive lookup for the license id in the deprecated licenses map. It returns true and the case-sensitive ID if found, otherwise false and the original id.

func IsException added in v2.6.0

func IsException(id string) (bool, string)

IsException does a case-insensitive lookup for the exception id in the exceptions map. It returns true and the case-sensitive ID if found, otherwise false and the original id.

func LicenseRanges

func LicenseRanges() [][][]string

LicenseRanges returns a list of license ranges.

Ranges are organized into groups (referred to as license groups) of the same base license (e.g. GPL). Groups have sub-groups of license versions (referred to as the range) where each member is considered to be the same version (e.g. {GPL-2.0, GPL-2.0-only}). The sub-groups are in ascending order within the license group, such that the first sub-group is considered to be less than the second sub-group, and so on. (e.g. {{GPL-1.0}, {GPL-2.0, GPL-2.0-only}} implies {GPL-1.0} < {GPL-2.0, GPL-2.0-only}).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL