golang-ci

command module
v0.0.0-...-2443963 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 7 Imported by: 0

README

golang-ci

Provides CI tools for Go programs.

Installation

GO111MODULE=off go get github.com/irvinlim/golang-ci

Usage

$ golang-ci
CI tool for Golang

Usage:
  golang-ci [command]

Available Commands:
  help             Help about any command
  lint             Runs linters using golangci-lint
  lint-install     Installs golangci-lint
  lint-install-all Installs all versions of golangci-lint

Flags:
  -h, --help   help for golang-ci

Use "golang-ci [command] --help" for more information about a command.
lint
$ golang-ci lint --help
Executes a specific version of golangci-lint, downloading to $GOPATH/bin as necessary.

Example usage:
  # Run default version. Note that the `--` is necessary to pass arguments to golangci-lint.
  golang-ci lint -- run -v

  # Run a specific version of golangci-lint.
  golang-ci lint --version v1.31.0 -- run -v

Usage:
  golang-ci lint [flags]

Flags:
  -h, --help             help for lint
      --version string   Version of golangci-lint to use. If not specified, will use latest version available.
lint-install
$ golang-ci lint-install --help
Installs a specific version of golangci-lint, downloading to $GOPATH/bin as necessary.

Example usage:
  # Installs the latest version at $GOPATH/bin/golangci-lint.
  golang-ci lint-install latest

  # Installs a specific version of golangci-lint at $GOPATH/bin/golangci-lint@v1.31.0.
  golang-ci lint-install v1.31.0

Usage:
  golang-ci lint-install VERSION [flags]

Flags:
  -h, --help   help for lint-install
lint-install-all
$ golang-ci lint-install-all --help
Installs all versions of golangci-lint, downloading to $GOPATH/bin.

Usage:
  golang-ci lint-install-all [flags]

Flags:
  -h, --help                 help for lint-install-all
      --min-version string   Minimum version of golangci-lint that should be installed.

Features

Virtual environment for golangci-lint

Runs Go linters using a specific version of golangci-lint.

When working on multiple Go projects which may have different versions of golangci-lint, having mismatched versions of golangci-lint in CI versus the copy of the golangci-lint binary on your local computer may cause your CI jobs to fail inadvertently.

This tool aims to provide a "virtual environment" for golangci-lint, by lazily downloading a specific version of golangci-lint if it is not present.

Example usage:

# Previously you might be calling golangci-lint as follows:
golangci-lint run -v --timeout=5m

# Instead, to use a specific version of golangci-lint using irvinlim/golang-ci, try this:
golang-ci lint --version v1.31.0 -- run -v --timeout=5m

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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