linters: # please, do not use `enable-all`: it's deprecated and will be removed soon. # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint disable-all: true enable: - bodyclose - depguard - dogsled - dupl - errcheck - exportloopref - funlen - goconst # - gocritic - gocyclo - gofmt - goimports - goprintffuncname - gosimple - govet - ineffassign - misspell - nolintlint - rowserrcheck - staticcheck - stylecheck # - typecheck - unconvert - unparam - unused - whitespace # - revive issues: include: - EXC0002 # disable excluding of issues about comments from golint exclude-rules: - linters: - stylecheck text: "ST1000:" # Excluding configuration per-path, per-linter, per-text and per-source - path: _test\.go linters: - gomnd # https://github.com/go-critic/go-critic/issues/926 - linters: - gocritic text: "unnecessaryDefer:" linters-settings: funlen: lines: 66 statements: 50 errcheck: # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. # Such cases aren't reported by default. # Default: false check-type-assertions: true # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`. # Such cases aren't reported by default. # Default: false check-blank: true # To disable the errcheck built-in exclude list. # See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details. # Default: false disable-default-exclusions: true # List of functions to exclude from checking, where each entry is a single function to exclude. # See https://github.com/kisielk/errcheck#excluding-functions for details. exclude-functions: - io/ioutil.ReadFile - io.Copy(*bytes.Buffer) - io.Copy(os.Stdout) - (*bytes.Buffer).WriteString - (*bytes.Buffer).Write - url.Parse - (*strings.Builder).WriteString - io.WriteString - (*bytes.Buffer).WriteByte - (*hmac.New).Write - (*int) - (*string) - (hash.Hash).Write depguard: # Rules to apply. # # Variables: # - File Variables # you can still use and exclamation mark ! in front of a variable to say not to use it. # Example !$test will match any file that is not a go test file. # # `$all` - matches all go files # `$test` - matches all go test files # # - Package Variables # # `$gostd` - matches all of go's standard library (Pulled from `GOROOT`) # # Default: Only allow $gostd in all files. rules: # Name of a rule. main: # Used to determine the package matching priority. # There are three different modes: `original`, `strict`, and `lax`. # Default: "original" list-mode: lax # List of file globs that will match this list of settings to compare against. # Default: $all files: - "!**/*_a _file.go" # List of allowed packages. allow: - $gostd - github.com/OpenPeeDeeP # Packages that are not allowed where the value is a suggestion. deny: - pkg: "github.com/pkg/errors" desc: Should be replaced by standard lib errors package