1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-08 03:13:27 +02:00
revive/rule
Bryan Boreham 7da6a39044
modifies-value-receiver: warn on slice or map (#943)
* modifies-value-receiver: warn on slice or map

Assignments which index into the slice or map are already ignored on
line 72, and those where the whole receiver is slice or map on line 50.
We should not ignore assignments where the member variable is slice
or map.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>

* Remove extra space

---------

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Co-authored-by: Denis Voytyuk <5462781+denisvmedia@users.noreply.github.com>
2023-11-28 15:45:52 +01:00
..
add-constant.go cleanup: removes or names unused parameters and receivers to _ (#907) 2023-09-24 08:55:14 +02:00
argument-limit.go adds default config to enable all rules work out of the box (#830) 2023-05-20 14:44:34 +02:00
atomic.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
banned-characters.go adds default config to enable all rules work out of the box (#830) 2023-05-20 14:44:34 +02:00
bare-return.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
blank-imports.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
bool-literal-in-expr.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
call-to-gc.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
cognitive-complexity.go adds default config to enable all rules work out of the box (#830) 2023-05-20 14:44:34 +02:00
comment-spacings.go Code cleaunp (#905) 2023-09-23 10:41:34 +02:00
confusing-naming.go Code cleaunp (#905) 2023-09-23 10:41:34 +02:00
confusing-results.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
constant-logical-expr.go cleanup: removes or names unused parameters and receivers to _ (#907) 2023-09-24 08:55:14 +02:00
context-as-argument.go code cleanup: replace interface{} with any (#906) 2023-09-24 08:44:02 +02:00
context-keys-type.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
cyclomatic.go adds default config to enable all rules work out of the box (#830) 2023-05-20 14:44:34 +02:00
datarace.go refactor: remove unused parameter from pick function (#932) 2023-11-06 11:01:38 +01:00
deep-exit.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
defer.go code cleanup: replace interface{} with any (#906) 2023-09-24 08:44:02 +02:00
doc.go Code cleaunp (#905) 2023-09-23 10:41:34 +02:00
dot-imports.go [dot-imports] support allow list of packages (#939) 2023-11-26 10:07:12 +01:00
duplicated-imports.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
early-return.go cleanup: removes or names unused parameters and receivers to _ (#907) 2023-09-24 08:55:14 +02:00
empty-block.go Prevent empty-block when looping over call expr 2023-05-01 10:44:48 +02:00
empty-lines.go fix bug #739: empty-lines false positive (#742) 2022-08-27 13:18:17 +02:00
enforce-map-style.go cleanup: removes or names unused parameters and receivers to _ (#907) 2023-09-24 08:55:14 +02:00
enforce-slice-style.go cleanup: removes or names unused parameters and receivers to _ (#907) 2023-09-24 08:55:14 +02:00
error-naming.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
error-return.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
error-strings.go Allow to customize user functions in rule error-strings (#703) 2022-07-05 21:51:50 +02:00
errorf.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
exported.go fix issue #691 (#700) 2022-06-28 18:14:26 +03:00
file-header.go adds default config to enable all rules work out of the box (#830) 2023-05-20 14:44:34 +02:00
flag-param.go refactor: remove unused parameter from pick function (#932) 2023-11-06 11:01:38 +01:00
function-length.go code cleanup: replace interface{} with any (#906) 2023-09-24 08:44:02 +02:00
function-result-limit.go adds default config to enable all rules work out of the box (#830) 2023-05-20 14:44:34 +02:00
get-return.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
identical-branches.go speedup branch comparison (#764) 2022-10-24 17:21:48 +02:00
if-return.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
import-alias-naming.go fix: ignore dot import aliases in import-alias-naming rule (#938) 2023-11-26 08:57:34 +01:00
import-shadowing.go fix: false positive in import-shadowing for method names (#876) 2023-08-21 23:45:41 +02:00
imports-blacklist.go Allow import-blacklist to run against go test files (#862) 2023-08-09 22:37:50 +02:00
increment-decrement.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
indent-error-flow.go cleanup: removes or names unused parameters and receivers to _ (#907) 2023-09-24 08:55:14 +02:00
line-length-limit.go adds default config to enable all rules work out of the box (#830) 2023-05-20 14:44:34 +02:00
max-public-structs.go adds default config to enable all rules work out of the box (#830) 2023-05-20 14:44:34 +02:00
modifies-param.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
modifies-value-receiver.go modifies-value-receiver: warn on slice or map (#943) 2023-11-28 15:45:52 +01:00
nested-structs.go fix #824 (#829) 2023-05-16 10:31:25 +02:00
optimize-operands-order.go refactor: remove unused parameter from pick function (#932) 2023-11-06 11:01:38 +01:00
package-comments.go refactor: Reduce package-comments output scope (#791) 2023-02-17 21:39:51 +01:00
range-val-address.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
range-val-in-closure.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
range.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
receiver-naming.go fix(receiver-naming): distinguish types with parameters (#692) 2022-06-18 18:47:53 +02:00
redefines-builtin-id.go fix issue #792 (#793) 2023-02-18 10:57:06 +01:00
redundant-import-alias.go feat: add rule for redundant import alias (#854) 2023-07-31 08:22:40 +02:00
string-format.go code cleanup: replace interface{} with any (#906) 2023-09-24 08:44:02 +02:00
string-of-int.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
struct-tag.go Code cleaunp (#905) 2023-09-23 10:41:34 +02:00
superfluous-else.go cleanup: removes or names unused parameters and receivers to _ (#907) 2023-09-24 08:55:14 +02:00
time-equal.go fix #846: time-equal garbled message when time returned from function (#868) 2023-08-12 09:05:46 +02:00
time-naming.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
unchecked-type-assertion.go quit config asap, remove unused pkg info (#896) 2023-09-17 11:10:49 +02:00
unconditional-recursion.go refactor: remove unused parameter from pick function (#932) 2023-11-06 11:01:38 +01:00
unexported-naming.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
unexported-return.go fix(receiver-naming): distinguish types with parameters (#692) 2022-06-18 18:47:53 +02:00
unhandled-error.go fix #754 [rule.unhandled-error] change arguments to regexp (#757) 2022-11-09 13:13:52 +01:00
unnecessary-stmt.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
unreachable-code.go add testing.FailNow and related function to unreachable check (#711) 2022-07-20 15:41:31 -07:00
unused-param.go refactor: remove unused parameter from pick function (#932) 2023-11-06 11:01:38 +01:00
unused-receiver.go refactor: remove unused parameter from pick function (#932) 2023-11-06 11:01:38 +01:00
use-any.go Revert "fix: unnecesary alert for use-any when comments inside interface{} (#873)" (#874) 2023-08-19 08:07:28 +02:00
useless-break.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
utils.go refactor: remove unused parameter from pick function (#932) 2023-11-06 11:01:38 +01:00
var-declarations.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00
var-naming.go var-naming: avoid allocations with (*regexp.Regexp).MatchString (#928) 2023-11-02 09:40:09 +01:00
waitgroup-by-value.go Lint cleanup (#679) 2022-04-10 11:55:13 +02:00