Help us shape the future of Go! Take the 2026 Go Developer Survey

golangci

package
v8.160.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package golangci generates the golangci-lint configuration of a Go repository, so that a bare `golangci-lint run`, the generated `make lint` and the generated pre-commit hook all lint with the same linters.

Index

Constants

View Source
const ConfigFile = ".golangci.yaml"

ConfigFile is the configuration written to a repository that has none.

Variables

View Source
var Linters = []string{"gosec", "goconst"}

Linters are the linters a generated Go repository lints with on top of golangci-lint's standard set.

Functions

func Ensure

func Ensure(path string, content []byte) ([]byte, error)

Ensure returns content, the configuration read from path, with every linter of Linters added to linters.enable that the configuration does not already enable, disable or get from `linters.default: all`. Lines are inserted into content as they are, so comments and layout stay; a configuration that needs nothing is returned unchanged.

func IsUnsupportedConfig

func IsUnsupportedConfig(err error) bool

IsUnsupportedConfig asserts unsupportedConfigError.

func NewInput

func NewInput(dir string) input.Input

NewInput returns the input that writes the configuration of the repository in dir: ConfigFile when the repository has no configuration, otherwise its own configuration with the missing Linters added to linters.enable and nothing else changed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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