license

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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