Skip to content

Adds a license header to any Go source files

License

Notifications You must be signed in to change notification settings

elastic/go-licenser

Folders and files

NameName
Last commit message
Last commit date
Jun 7, 2023
Jun 7, 2023
Aug 17, 2022
Aug 17, 2022
Aug 29, 2022
Aug 30, 2018
Jun 4, 2020
Apr 19, 2018
Apr 19, 2018
Jun 1, 2023
Aug 9, 2019
Feb 13, 2023
Dec 11, 2024
Aug 9, 2019
Aug 9, 2019
Feb 16, 2023
Feb 13, 2023
Feb 13, 2023
Aug 1, 2018
Aug 1, 2018
Aug 17, 2022
Aug 30, 2018

Repository files navigation

Go Licenser Build Status

Small zero dependency license header checker for source files. The aim of this project is to provide a common binary that can be used to ensure that code source files contain a license header. It's unlikely that this project is useful outside of Elastic at the current stage, but the licensing package can be used as a building block.

Supported Licenses

  • Apache 2.0
  • Elastic
  • Elastic 2.0
  • Elastic Cloud

Supported languages

  • Go

Installing

go get -u github.com/elastic/go-licenser

Usage

Usage: go-licenser [flags] [path]

  go-licenser walks the specified path recursively and appends a license Header if the current
  header doesn't match the one found in the file.

Options:

  -copyright
        sets the copyright string as the first line
  -d    skips rewriting files and returns exitcode 1 if any discrepancies are found.
  -exclude value
        path to exclude (can be specified multiple times).
  -ext string
        sets the file extension to scan for. (default ".go")
  -license string
        sets the license type to check: ASL2, ASL2-Short, Cloud, Elastic, Elasticv2 (default "ASL2")
  -licensor string
        sets the name of the licensor (default "Elasticsearch B.V.")
  -version
        prints out the binary version.

Contributing

See CONTRIBUTING.md.