Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
6 of 7 tasks
xeptore opened this issue Jan 1, 2025 · 2 comments · Fixed by #5274
Closed
6 of 7 tasks

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

xeptore opened this issue Jan 1, 2025 · 2 comments · Fixed by #5274
Labels
area: cgo Related to CGO or line directives bug Something isn't working

Comments

@xeptore
Copy link

xeptore commented Jan 1, 2025

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

@xeptore xeptore added the bug Something isn't working label Jan 1, 2025
Copy link

boring-cyborg bot commented Jan 1, 2025

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@xeptore
Copy link
Author

xeptore commented Jan 1, 2025

@ldez, I just saw you labeled #5271 as area:cgo while I was writing the issue description. I encountered that issue initially, however it seemed to me related to a different topic, which doesn't seem that much irrelevant after following the discussion there. So, I'm closing this issue. Feel free to reopen it, and thank you for your efforts!

@xeptore xeptore closed this as completed Jan 1, 2025
@ldez ldez added duplicate This issue or pull request already exists area: cgo Related to CGO or line directives bug Something isn't working and removed bug Something isn't working duplicate This issue or pull request already exists labels Jan 1, 2025
@ldez ldez reopened this Jan 1, 2025
@ldez ldez mentioned this issue Jan 1, 2025
@ldez ldez closed this as completed in #5274 Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cgo Related to CGO or line directives bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants