-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
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
typechecksection 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
How did you install golangci-lint?
I don't know
Description of the problem
it is a minor problem that boils down to false positives and wrong recommendations
reproducible if you just
git clone https://github.com/NVIDIA/aistore
make lintThe result:
$ golangci-lint version
golangci-lint has version 2.7.0 built with go1.25.4 from e6ebea01 on 2025-12-03T19:50:52Z
$
$ make lint
Running lint...
ais/backend/azure.go:194:11: stringscut: strings.Index can be simplified using strings.Cut (modernize)
if i := strings.Index(line, azErrCode); i > 0 {
^
ais/dpq.go:244:10: stringscut: strings.IndexByte can be simplified using strings.Cut (modernize)
if i := strings.IndexByte(s, '='); i > 0 {
^
cmn/bck.go:120:9: stringscut: strings.IndexByte can be simplified using strings.Cut (modernize)
idx := strings.IndexByte(s, apc.NsNamePrefix)
^
cmn/certloader/certloader.go:314:7: stringscut: strings.Index can be simplified using strings.Cut (modernize)
i := strings.Index(s, " +")
^
cmn/cos/template.go:405:12: stringscut: strings.IndexByte can be simplified using strings.Cut (modernize)
right := strings.IndexByte(template, '@')
^
cmn/k8s/k8s.go:113:9: stringscut: strings.IndexByte can be simplified using strings.Cut (modernize)
idx := strings.IndexByte(msg, ',')
^
fs/fqn.go:57:7: stringscut: strings.IndexByte can be simplified using strings.Cut (modernize)
j := strings.IndexByte(ct, filepath.Separator)
^
api/multiobj.go:5:9: var-naming: avoid meaningless package names (revive)
package api
^
8 issues:
* modernize: 7
* revive: 1
make: *** [Makefile:291: lint] Error 1Problems:
- IndexByte() does not apply
- Index() should not be recommended when we are specifically looking for
i > 0 - revive error makes no sense
Version of golangci-lint
$ golangci-lint --version
# Paste output hereConfiguration
# paste configuration file or CLI flags hereGo environment
$ go version && go env
# paste output hereVerbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v
# paste output hereA minimal reproducible example or link to a public repository
// add your code hereValidation
- Yes, I've included all information above (version, config, etc.).
Supporter
- I am a sponsor/backer through GitHub or OpenCollective
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested