license

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package license provides SPDX license identifier normalization. It embeds the official SPDX license list and the CycloneDX curated alias mapping, then maps free-form license names and URLs to their canonical SPDX identifiers.

Update the embedded data with:

go generate ./license/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(name, url string) string

Normalize maps a license name or URL to its SPDX identifier or expression. It tries the following in order:

  1. Exact SPDX ID match (input is already a valid SPDX ID)
  2. URL match against seeAlso cross-references from the SPDX license list
  3. Name match against official SPDX license names (case-insensitive)
  4. Name match against CycloneDX curated alias mapping (case-insensitive)

Returns the original input unchanged if no match is found.

func Version

func Version() string

Version returns the embedded SPDX license list version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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