Strange noliteral behavior (false positive) #16

Closed
opened 2024-01-26 14:10:23 +00:00 by dkirillov · 0 comments
Member

I run noliteral linter and get the following error

api/layer/layer.go:719:67  truecloudlab-linters  noliteral: Wrong package for constants

In my code lines 718-719 looks like:

n.reqLogger(ctx).Debug(logs.CouldntDeleteObjectFromStorageContinueDeleting,         // line 718
	zap.Stringer("cid", bkt.CID), zap.String("oid", obj.VersionID), zap.Error(obj.Error))    // line 719

If I change them to:

n.reqLogger(ctx).Debug(logs.CouldntDeleteObjectFromStorageContinueDeleting,       // line 718
	zap.Stringer("cid", bkt.CID), zap.String("oid", obj.VersionID))                   // line 719

linter stops complain about my code.

See the PR with this check failed TrueCloudLab/frostfs-s3-gw#294

I run noliteral linter and get the following error ```shell api/layer/layer.go:719:67 truecloudlab-linters noliteral: Wrong package for constants ``` In my code lines 718-719 looks like: ```golang n.reqLogger(ctx).Debug(logs.CouldntDeleteObjectFromStorageContinueDeleting, // line 718 zap.Stringer("cid", bkt.CID), zap.String("oid", obj.VersionID), zap.Error(obj.Error)) // line 719 ``` If I change them to: ```golang n.reqLogger(ctx).Debug(logs.CouldntDeleteObjectFromStorageContinueDeleting, // line 718 zap.Stringer("cid", bkt.CID), zap.String("oid", obj.VersionID)) // line 719 ``` linter stops complain about my code. See the PR with this check failed https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pulls/294
achuprov was assigned by fyrchik 2024-01-26 14:14:08 +00:00
dkirillov added the
bug
label 2024-02-02 14:02:24 +00:00
fyrchik referenced this issue from a commit 2024-02-14 07:55:53 +00:00
Sign in to join this conversation.
No description provided.