Skip to content

jfrog/go-license-discovery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

A go library for matching text against known OSS licenses

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages