Skip to content

Unexpected gci linter error after upgrading to v1.63.0 #5273

@xeptore

Description

@xeptore

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

Description of the problem

After upgrading to v1.63.0, gci linter fails with the following error message:

iphlpapi\api.go:10:1: File is not properly formatted (gci)
*/
^

exit status 8
task: Failed to run task "lint:ci": exit status 1

Failing workflow job: https://github.com/xeptore/linkos/actions/runs/12569153432/job/35037538483
Failing workflow job raw log: archive (specifically, Lint Client job):
logs_32589747240.zip

Workflow run before the upgrade: https://github.com/xeptore/linkos/actions/runs/12569153432/job/35037538483
Successful workflow job raw log archive before the upgrade:
logs_32584257385.zip

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version v1.63.0 built with go1.23.4 from (unknown, modified: ?, mod sum: "h1:4HZnKnU9nA08TQpzpl5Ngrr79B/tEvv0UJVZ92K0k1k=") on (unknown)

Configuration

Same config file used before and after the upgrade: https://github.com/xeptore/linkos/blob/bf3340c97fb54bfc339bccc0c97b50105a3d2cc6/.golangci.yaml

run:
  issues-exit-code: 8
  timeout: 10m
linters:
  disable:
    - cyclop
    - contextcheck
    - depguard
    - dupl
    - exportloopref
    - forbidigo
    - forcetypeassert
    - funlen
    - gochecknoglobals
    - gochecknoinits
    - gocognit
    - gocyclo
    - err113
    - ireturn
    - lll
    - maintidx
    - mnd
    - nestif
    - nlreturn
    - nonamedreturns
    - revive
    - tagliatelle
    - testpackage
    - varnamelen
    - wrapcheck
    - wsl
  presets:
    - bugs
    - comment
    - complexity
    - error
    - format
    - import
    - metalinter
    - module
    - performance
    - sql
    - style
    - test
    - unused
linters-settings:
  errorlint:
    errorf: false
    errorf-multi: true
    asserts: true
    comparison: true
  gci:
    sections:
      - standard
      - default
      - prefix(github.com/xeptore/linkos)
    skip-generated: false
  gosec:
    excludes:
      - G601
  nlreturn:
    block-size: 1
  tagliatelle:
    case:
      use-field-name: true
      rules:
        json: camel
        yaml: snake
        envconfig: upperSnake

Go environment

$ go version && go env
go version go1.23.4 windows/amd64
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Hasbi\AppData\Local\go-build
set GOENV=C:\Users\Hasbi\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\dev\env\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\dev\env\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=D:\dev\env\go\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=D:\dev\env\go\go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.23.4
set GODEBUG=
set GOTELEMETRY=off
set GOTELEMETRYDIR=C:\Users\Hasbi\AppData\Roaming\go\telemetry
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=clang
set CXX=clang++
set CGO_ENABLED=1
set GOMOD=NUL
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\Hasbi\AppData\Local\Temp\go-build3881085242=/tmp/go-build -gno-record-gcc-switches

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

Cleaned cache. Let me know if you need another workflow run with -v flag set.

A minimal reproducible example or link to a public repository

Failing file: https://github.com/xeptore/linkos/blob/bf3340c97fb54bfc339bccc0c97b50105a3d2cc6/iphlpapi/api.go
Before/after upgrade workflow links/logs are provided above.

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cgoRelated to CGO or line directivesbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions