go-license-discovery

module
v0.0.0-...-c4913dc Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: Apache-2.0

README

go-license-discovery

The license discovery is a library and set of tools that can analyze license text to determine what type of license it contains. It searches for license texts in a file and compares them to an archive of known licenses

This library encapsulate logic from 2 best licenses detection libraries :

In Addition this library uses :

  • checksum based cache to have better performance detection of licenses which already been met
  • analyzed pom file to detect licenses which presented in the pom as a comment

Example :

  • Copy licenses.db file:
copy licenses.db (located under matcher/licenses/licenses.db) file to <licenses folder>
  • Init license matcher:
matcher.InitLicenseMatcher(<licenses folder>)
  • Match licenses txt file to a known spdx licenses.
matcher.MatchLicenseTxt(licenseTxt)
  • Read License from pom file comments and match it to a known spdx licenses.
matcher.GetPomCommentLicense(pomFile)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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