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 MakePairs

func MakePairs(p1 *spdx.Package, p2 *spdx.Package) (map[string]LicensePair, error)

MakePairs 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.5.5 (latest)
Published
Jun 17, 2024
Platform
linux/amd64
Imports
1 packages
Last checked
3 weeks ago

Tools for package owners.