Skip to content

mittwald/golangci-lint-cfg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

42541d0 · Sep 23, 2024

History

82 Commits
Apr 25, 2023
Jan 22, 2021
Nov 23, 2023
Apr 25, 2023
Sep 23, 2024
Sep 23, 2024
Jan 15, 2021
Apr 25, 2023
Apr 25, 2023

Repository files navigation

Golang CI Linter Config

Usage

Basic

$ docker run \
    -v $(go env GOPATH):/go \
    -v $(pwd):/app \
    -w /app \
    --rm quay.io/mittwald/golangci-lint:latest \
        golangci-lint run -v ./...

With config-merging

Mount additional config to pre-defined path

$ docker run \
    -v $(go env GOPATH):/go \
    -v $(pwd):/app \
    -w /app \
    -v /path/to/.golangci.yml:/.golangci.yml \
    --rm quay.io/mittwald/golangci-lint:latest \
        golangci-lint run -v ./...

Change pre-defined path to fit your needs

$ docker run \
    -v $(go env GOPATH):/go \
    -v $(pwd):/app \
    -w /app \
    -e GOLANGCI_ADDITIONAL_YML="/app/path/to/.golangci.yml" \
    --rm quay.io/mittwald/golangci-lint:latest \
        golangci-lint run -v ./...

Recommended Goland Settings

  • Settings > Tools > File Watcher: Add go fmt.

  • Settings > Editor > Code Style > Go

    • Tabs and Indents

      code style tabs and indents

    • Wrapping and braces

      wrapping and braces

    • Imports

      code style imports

    • Other: Activate Add leading space to comments

      other