pingcap / pingcap/tidb

Suspicious assignment to a by-value method receiver

Open
#47,395 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

https://github.com/pingcap/tidb/blob/a3bafcdffb1008d224fe06af717e231c82b8f6b1/executor/aggfuncs/func_group_concat.go#L304-L311

The assignment `h.err = err` (line 309) has no effect outside the method because the method has a by-value receiver.
Either the receiver must be changed to be by reference or the assignment removed.

(found by [revive](https://github.com/mgechev/revive) while testing it on tidb code base)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.