Version: v2.0.3 Latest Latest

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

Go to latest
Published: Aug 12, 2019 License: Apache-2.0 Imports: 7 Imported by: 0




This section is empty.


This section is empty.


func LicenseText

func LicenseText(text string, strictness Strictness) string

LicenseText makes a license text ready for analysis. It follows SPDX guidelines at

func Relax

func Relax(text string) string

Relax applies very aggressive normalization rules to text.

func Split

func Split(text string) []string

Split applies heuristics to split the text into several parts


type Strictness

type Strictness int

Strictness represents the aggressiveness of the performed normalization. The bigger the number, the more aggressive. See `Enforced`, `Moderate` and `Relaxed`.

const (
	// Enforced is the strictest mode - only the official SPDX guidelines are applied.
	Enforced Strictness = 0
	// Moderate is equivalent to Enforced with some additional normalization: dots are removed, copyright lines too.
	Moderate Strictness = 1
	// Relaxed is the most powerful normalization, Moderate + Unicode normalization and all non-alphanumeric chars removed.
	Relaxed Strictness = 2

Source Files

Jump to

Keyboard shortcuts

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