package licensediff

import "github.com/spdx/tools-golang/licensediff"

Package licensediff is used to generate a "diff" between the concluded licenses in two SPDX Packages, using the filename as the match point. SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later

Index

Functions

func MakePairs2_1

func MakePairs2_1(p1 *v2_1.Package, p2 *v2_1.Package) (map[string]LicensePair, error)

MakePairs2_1 essentially just consolidates all files and LicenseConcluded strings into a single data structure.

func MakePairs2_2

func MakePairs2_2(p1 *v2_2.Package, p2 *v2_2.Package) (map[string]LicensePair, error)

MakePairs2_2 essentially just consolidates all files and LicenseConcluded strings into a single data structure.

func MakePairs2_3

func MakePairs2_3(p1 *v2_3.Package, p2 *v2_3.Package) (map[string]LicensePair, error)

MakePairs2_3 essentially just consolidates all files and LicenseConcluded strings into a single data structure.

Types

type LicenseDiff

type LicenseDiff struct {
	InBothChanged map[string]LicensePair
	InBothSame    map[string]string
	InFirstOnly   map[string]string
	InSecondOnly  map[string]string
}

LicenseDiff is a structured version of the output of MakePairs. It is meant to make it easier to find and report on, e.g., just the files that have different licenses, or those that are in just one scan.

func MakeResults

func MakeResults(pairs map[string]LicensePair) (*LicenseDiff, error)

MakeResults creates a more structured set of results from the output of MakePairs.

type LicensePair

type LicensePair struct {
	First  string
	Second string
}

LicensePair is a result set where we are talking about two license strings, potentially differing, for a single filename between two SPDX Packages.

Source Files

licensediff.go

Version
v0.4.0
Published
Jan 12, 2023
Platform
darwin/amd64
Imports
3 packages
Last checked
3 minutes ago

Tools for package owners.