Skip to content

gci auto fix is broken #2591

Closed
Closed
@Dreamacro

Description

@Dreamacro

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

gci only report issues but it won't fix it

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version v1.44.1

Configuration file

$ cat .golangci.yml
linters:
  disable-all: true
  enable:
    - gofumpt
    - govet
    - gci

issues:
  fix: true

linters-settings:
  gci:
    sections:
      - standard
      - prefix(github.com/pkg/pkg)
      - default

Go environment

$ go version && go env
go version go1.17.6 darwin/arm64

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO [runner] linters took 924.918333ms with stages: goanalysis_metalinter: 924.218458ms
INFO fixer took 0s with no stages
component/dialer/bind_darwin.go:7:4: Expected 'i', Found 'o' at component/dialer/bind_darwin.go[line 7,col 4] (gci)
	"golang.org/x/sys/unix"
	  ^
INFO File cache stats: 1 entries of total size 1.4KiB
INFO Memory: 13 samples, avg is 273.7MB, max is 352.6MB
INFO Execution took 1.127992166s

Code example or link to a public repository

import (
	"net"
	"syscall"

	"golang.org/x/sys/unix"

	"github.com/pkg/pkg"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions