go-licenses
is a small CLI which allows you to export and check the licenses of your dependencies from your go.mod
file.
go install github.com/aboutyou/go-licenses
The project uses licenseclassifier to classify the licenses of each package.
To export all modules and their packages run one of the following commands:
go-licenses export csv > licenses.csv
or
go-licenses export json > licenses.json
The check
command validates that all the modules in the project use compatible licenses.
go-licenses check
By default the following licenses are allowed:
- Apache20
- BSD2Clause
- BSD3Clause
- MIT
- Facebook3Clause
- Ruby
- PHP301
- Python20
In Go 1.18 there will be a new package debug/buildinfo which will allow us to offer the commands also for compiled Go programms.
This will allow to run license compliance terms on your shipped binaries.