cmd/go: include .Module.LicenseFile field in output of list -json #37952
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
FrozenDueToAge
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
This might be somewhat beyond the remit of
cmd/go list
, but raising the issue for completeness in any case.In the process of developing a module, one needs to consider the licenses of dependencies. (Noting that in https://groups.google.com/forum/#!topic/golang-nuts/VKkLK7xSX5I I'm trying to establish whether only a subset of the module graph is relevant in this respect)
I'm considering creating tooling to aid the process of dependency license review by creating a log file of the following format (expanded for all dependencies, modulo the question in https://groups.google.com/forum/#!topic/golang-nuts/VKkLK7xSX5I):
Code generating this log, having CI re-generate this log and check that any given commit is "clean" will ensure that any changes to dependencies (or their licenses) get flagged in a PR/CL for review.
However a pre-requisite for creating such a log is being able to extract the license file contents.
pkg.go.dev has some internal logic for finding the license file. I'd like to propose we add this logic to
cmd/go
and expose the license file via a.Module.LicenseFile
field, which is set toos.DevNull
in case no license is found.cc @bcmills @jayconrod @matloob
The text was updated successfully, but these errors were encountered: