Skip to content

Instead of hardcoding license text in "metadata.go", would we consider using the License text obtained from GitHub API using github.com/google/go-github? #242

@wlyu2

Description

@wlyu2

rr, _, err := gitHub.Repositories.Get(context.TODO(), owner, repo)

On this line, variable "rr" points to a "github.Repository" object with a "License" field in which the there is a GitHub URL pointing to the License text.

License:github.License{Key:"bsd-2-clause", Name:"BSD 2-Clause "Simplified" License", URL:"https://api.github.com/licenses/bsd-2-clause", SPDXID:"BSD-2-Clause"}

Would you think that it is better for dh-make-golang to obtain the license text from this URL rather than getting the license text from the hard-coded dictionary in metadata.go?

var debianLicenseText = map[string]string{

P.S. For the license example above, the hard-coded dictionary does not even have a bsd-2-clause as its key. As a result, the generated debian/copyright only has a "TODO" under the generated License stanza:

Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://github.com/go-warnings/warnings
Upstream-Name: warnings.v0
Upstream-Contact: TODO

Files: *
Copyright: 2016 
License: BSD-2-clause

Files: debian/*
Copyright: 2025 TODO <TODO>
License: BSD-2-clause
Comment: Debian packaging is licensed under the same terms as upstream

License: BSD-2-clause
 TODO

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions