gocredits

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 22 Imported by: 3

README

gocredits

Test Status MIT License PkgGoDev

gocredits creates CREDITS file from LICENSE files of dependencies

Synopsis

gocredits . > CREDITS

Description

When distributing built executable in Go, we need to include LICENSE of the dependent libraries into the package, so gocredits bundle them together as a CREDITS file.

To use gocredits, we should use go modules for dependency management.

Installation

homebrew
% brew install Songmu/tap/gocredits
go get
% go install github.com/Songmu/gocredits/cmd/gocredits@latest
aqua
% aqua g -i Songmu/gocredits

Built binaries are available on GitHub Releases. https://github.com/Songmu/gocredits/releases

GitHub Actions

The action installs and runs gocredits, overwriting CREDITS in the repository root:

permissions:
  attestations: read
  contents: read

steps:
- uses: actions/checkout@v7
- id: gocredits
  uses: Songmu/gocredits@v0

The module directory, missing-license behavior, and output format can be configured:

- uses: Songmu/gocredits@v0
  with:
    directory: ./path/to/module
    skip-missing: true
    format: |
      {{range .Licenses}}{{.Name}}
      {{end}}

The action outputs the absolute credits path and a changed value indicating whether the file contents changed. It does not commit or push the generated file. The attestations: read permission allows the action to verify the downloaded gocredits binary. The contents: read permission is required by the checkout step.

Author

Songmu

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(argv []string, outStream, errStream io.Writer) error

Run the gocredits

Types

This section is empty.

Directories

Path Synopsis
cmd
gocredits command

Jump to

Keyboard shortcuts

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