licensegen

command
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

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