Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork178
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Welcome
Description of the problemWe have a .golangci-lint.yml in the root of the repo. We haven't change golangci-lint version in 6 months and out of nowhere it's applying new rules. I updated the config in a new branch and the workflow still applies the same rules. Failing workflows can be seen here:https://github.com/gofiber/fiber/actions/workflows/linter.yml I created a new PR with updated config to ignore the issues and even though it works locally it fails on the CI while ignoring by config. Trying to fix issues in this PR:gofiber/fiber#3354 Version of golangci-lint1.64.7 Version of the GitHub Actionlatest Workflow filename:golangci-linton:push:branches: -master -mainpaths-ignore: -"**/*.md"pull_request:paths-ignore: -"**/*.md"permissions:# Required: allow read access to the content for analysis.contents:read# Optional: allow read access to pull request. Use with `only-new-issues` option.pull-requests:read# Optional: Allow write access to checks to allow the action to annotate code in the PR.checks:writejobs:golangci:name:lintruns-on:ubuntu-lateststeps: -uses:actions/checkout@v4 -uses:actions/setup-go@v5with:# NOTE: Keep this in sync with the version from go.modgo-version:"1.23.x"cache:false -name:golangci-lintuses:golangci/golangci-lint-action@v6with:# NOTE: Keep this in sync with the version from .golangci.ymlversion:v1.62.2 Golangci-lint configurationrun:timeout:5mmodules-download-mode:readonlyallow-serial-runners:trueoutput:sort-results:trueuniq-by-line:falselinters-settings:depguard:rules:all:list-mode:laxdeny: -pkg:"flag"desc:'`flag` package is only allowed in main.go' -pkg:"log"desc:'logging is provided by `pkg/log`' -pkg:"io/ioutil"desc:'`io/ioutil` package is deprecated, use the `io` and `os` package instead'# TODO: Prevent using these without a reason# - pkg: "reflect"# desc: '`reflect` package is dangerous to use'# - pkg: "unsafe"# desc: '`unsafe` package is dangerous to use'errcheck:check-type-assertions:truecheck-blank:truedisable-default-exclusions:trueexclude-functions: -'(*bytes.Buffer).Write'# always returns nil error -'(*github.com/valyala/bytebufferpool.ByteBuffer).Write'# always returns nil error -'(*github.com/valyala/bytebufferpool.ByteBuffer).WriteByte'# always returns nil error -'(*github.com/valyala/bytebufferpool.ByteBuffer).WriteString'# always returns nil errorerrchkjson:report-no-exported:trueexhaustive:check-generated:truedefault-signifies-exhaustive:trueforbidigo:forbid: -^print(ln)?$ -^fmt\.Print(f|ln)?$ -^http\.Default(Client|ServeMux|Transport)$# TODO: Eventually enable these patterns# - ^panic$# - ^time\.Sleep$analyze-types:truegci:sections: -standard -prefix(github.com/gofiber/fiber) -default -blank -dot# - aliascustom-order:truegoconst:numbers:truegocritic:# TODO: Uncomment the following linesenabled-tags: -diagnostic# - style# - performance# - experimental# - opinionatedsettings:captLocal:paramsOnly:falseelseif:skipBalanced:falseunderef:skipRecvDeref:false# NOTE: Set this option to false if other projects rely on this project's code# unnamedResult:# checkExported: falsegofumpt:module-path:github.com/gofiber/fiberextra-rules:truegosec:excludes: -G104# TODO: Enable this again. Mostly provided by errcheckconfig:global:# show-ignored: true # TODO: Enable thisaudit:truegovet:enable-all:truedisable: -shadowgrouper:# const-require-grouping: true # TODO: Enable thisimport-require-single-import:trueimport-require-grouping:true# var-require-grouping: true # TODO: Conflicts with gofumptloggercheck:require-string-key:trueno-printf-like:truemisspell:locale:USnolintlint:require-explanation:truerequire-specific:truenonamedreturns:report-error-in-defer:trueperfsprint:err-error:truepredeclared:q:truepromlinter:strict:true# TODO: Enable this# reassign:# patterns:# - '.*'revive:enable-all-rules:truerules:# Provided by gomnd linter -name:add-constantdisabled:true -name:argument-limitdisabled:true# Provided by bidichk -name:banned-charactersdisabled:true -name:cognitive-complexitydisabled:true -name:comment-spacingsarguments: -nolintdisabled:true# TODO: Do not disable -name:cyclomaticdisabled:true# TODO: Enable this check. Currently disabled due to upstream bug.# - name: enforce-repeated-arg-type-style# arguments:# - short -name:enforce-slice-stylearguments: -makedisabled:true# TODO: Do not disable -name:exporteddisabled:true -name:file-headerdisabled:true -name:function-result-limitarguments:[3] -name:function-lengthdisabled:true -name:line-length-limitdisabled:true -name:max-public-structsdisabled:true -name:modifies-parameterdisabled:true -name:nested-structsdisabled:true# TODO: Do not disable -name:package-commentsdisabled:true -name:optimize-operands-orderdisabled:true -name:unchecked-type-assertiondisabled:true# TODO: Do not disable -name:unhandled-errorarguments:['bytes\.Buffer\.Write']stylecheck:checks: -all --ST1000 --ST1020 --ST1021 --ST1022tagalign:strict:truetagliatelle:case:rules:json:snaketenv:all:truetestifylint:enable-all:truetestpackage:skip-regexp:"^$"unparam:# NOTE: Set this option to false if other projects rely on this project's codecheck-exported:falseunused:# TODO: Uncomment these two lines# parameters-are-used: false# local-variables-are-used: false# NOTE: Set these options to true if other projects rely on this project's codefield-writes-are-uses:true# exported-is-used: true # TODO: Fix issues with this option (upstream)exported-fields-are-used:trueusestdlibvars:http-method:truehttp-status-code:truetime-weekday:false# TODO: Set to truetime-month:false# TODO: Set to truetime-layout:false# TODO: Set to truecrypto-hash:truedefault-rpc-path:truesql-isolation-level:truetls-signature-scheme:trueconstant-kind:truewrapcheck:ignorePackageGlobs: -github.com/gofiber/fiber/* -github.com/valyala/fasthttpissues:exclude-use-default:falseexclude-case-sensitive:truemax-issues-per-linter:0max-same-issues:0exclude-dirs: -internal# TODO: Do not ignore interal packagesexclude-rules: -linters: -err113text:'do not define dynamic errors, use wrapped static errors instead*' -path:log/.*\.golinters: -depguard# Exclude some linters from running on tests files. -path:_test\.golinters: -bodyclose -err113# fix: truelinters:enable: -asasalint -asciicheck -bidichk -bodyclose -containedctx -contextcheck# - cyclop -decorder -depguard -dogsled# - dupl -dupword# TODO: Enable -durationcheck -errcheck -errchkjson -errname -errorlint -exhaustive# - exhaustivestruct# - exhaustruct -copyloopvar -forbidigo -forcetypeassert# - funlen# - gci # TODO: Enable -ginkgolinter# - gocheckcompilerdirectives # TODO: Enable# - gochecknoglobals # TODO: Enable# - gochecknoinits # TODO: Enable -gochecksumtype# - gocognit -goconst# TODO: Enable -gocritic# - gocyclo# - godot# - godox -err113 -gofmt -gofumpt# - goheader -goimports# - mnd # TODO: Enable -gomoddirectives# - gomodguard -goprintffuncname -gosec -gosimple# - gosmopolitan # TODO: Enable -govet -grouper# - ifshort # TODO: Enable# - importas# - inamedparam -ineffassign# - interfacebloat# - interfacer# - ireturn# - lll -loggercheck# - maintidx -makezero# - maligned -mirror -misspell -musttag -nakedret# - nestif -nilerr -nilnil# - nlreturn -noctx -nolintlint -nonamedreturns -nosprintfhostport# - paralleltest # TODO: Enable -perfsprint# - prealloc -predeclared -promlinter -protogetter -reassign -revive -rowserrcheck# - scopelint # TODO: Enable -sloglint -spancheck -sqlclosecheck -staticcheck -stylecheck# - tagalign # TODO: Enable -tagliatelle -tenv -testableexamples -testifylint# - testpackage # TODO: Enable -thelper -tparallel -typecheck -unconvert -unparam -unused -usestdlibvars# - varnamelen# - wastedassign # TODO: Enable -whitespace -wrapcheck# - wsl -zerologlint Go version1.23.x Code example or link to a public repositoryn/a |
BetaWas this translation helpful?Give feedback.
All reactions
I will open a dedicated issue:golangci/golangci-lint#5580
Replies: 1 comment 22 replies
-
We are stuck unable to run any CI workflows because of this. Running locally returns 0 errors. Running on the workflow returns over +10 errors |
BetaWas this translation helpful?Give feedback.
All reactions
-
I saw yourcomment, I'm still on the topic. FYI, the problem seems to affect only some revive rules: at least |
BetaWas this translation helpful?Give feedback.
All reactions
-
It takes me days but I found where is the problem, for now I don't have solution because I just discover it. Just wanted to shared because it was a very very long debug session |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 2
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
The following
The problem is hidden because an error is ignored inside The problem cannot be easily detected by tests because it requires using 2 different For now, I have no idea how to fix that, but I'm working on it. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I will open a dedicated issue:golangci/golangci-lint#5580 |
BetaWas this translation helpful?Give feedback.
All reactions
👍 2
-
@ldez Thanks for the help with this. Glad this was found, pretty sure it has been there for a long time |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
This discussion was converted from issue #1197 on March 15, 2025 15:02.
