Documentation
¶
Overview ¶
Command licensegen regenerates THIRD_PARTY_LICENSES.txt at the repository root: the attribution notices for every third-party Go module linked into the digitalx-cli binary. The compiled binary statically links these modules, so their permissive licenses (MIT / BSD / ISC / Apache-2.0) require their copyright and permission notices to travel with every copy we distribute. The generated file is shipped inside each release archive (see the archive `files` list in .goreleaser.yaml) and `digitalx license` points at it in the source repository.
Run from the module root:
go run ./tools/licensegen
or `make licenses`. Commit the regenerated file. The output is deterministic (modules sorted, files sorted) so re-running with no dependency change is a no-op diff.
Discovery mirrors what a license scanner does: for every package actually linked into the binary (`go list -deps` on the main package, standard-library packages excluded), find the nearest LICENSE/COPYING/NOTICE-style file walking up from the package directory to its module root, and additionally take any NOTICE at the module root (Apache-2.0 §4(d)). Files are de-duplicated by path, so a module that carries extra per-directory notices (e.g. a vendored third-party license inside one subpackage) contributes all of them exactly once.
The listing runs once per release target and the results are unioned — see releaseTargets and listPackages — because build constraints make the linked dependency set platform-specific.