-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: enable noloopclosure #37153
*: enable noloopclosure #37153
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
d7e6d26
to
4501831
Compare
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/80e7fff0483cafaa3d6e31fb9fe122a2e13efcb4 |
/run-mysql-test tidb-test=pr/1927 |
1 similar comment
/run-mysql-test tidb-test=pr/1927 |
/run-mysql-test tidb-test=pr/1927 |
4 similar comments
/run-mysql-test tidb-test=pr/1927 |
/run-mysql-test tidb-test=pr/1927 |
/run-mysql-test tidb-test=pr/1927 |
/run-mysql-test tidb-test=pr/1927 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 0599642
|
TiDB MergeCI notify🔴 Bad News! [2] CI still failing after this pr merged.
|
…verage * upstream/master: (109 commits) *: rename TemporaryTableAttachedInfoSchema (pingcap#37408) *: enable noloopclosure (pingcap#37153) executor: add JSON opaque value condition to everywhere (pingcap#37390) *: refine mock session manager (pingcap#37400) lightning: check counter value to make code more robust (pingcap#37380) *: use go 1.19 (pingcap#36223) br: restore tiflash replica count after PiTR (pingcap#37181) testkit,executor: add MustQueryWitnContext API and fix unstable test TestCoprocessorPriority (pingcap#37382) executor: add conversion to opaque value for json_objectagg and json_arrayagg (pingcap#37337) expression: quote json path if necessarily (pingcap#37375) *: support ACCOUNT (UN)LOCK when creating/altering user (pingcap#37052) log-backup: support the ddl(exchange partition) when PiTR (pingcap#37050) *: change `integration.BeforeTest` to `integration.BeforeTestExternal` to avoid skip tests (pingcap#37341) executor: fix unstable TestGlobalMemoryTrackerOnCleanUp (pingcap#37372) util/ranger: avoid building ranges twice in detachCNFCondAndBuildRangeForIndex (pingcap#37177) statistics: track used stats status during query (pingcap#37101) *: fix data race in `TestTiFlashGroupIndexWhenStartup` (pingcap#37371) lightning: fix dpanic log when init session vars (pingcap#37301) executor: let plan replayer record table tiflash replica (pingcap#37336) types: fix a bug in casting str2str when `union` (pingcap#37242) ...
Signed-off-by: Weizhen Wang wangweizhen@pingcap.com
What problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
What is changed and how it works?
loopclosure
will only complain if the captured loop variable is inside of a function closure that preceded bygo
anddefer
keyword and is the last statement in the loop's block ([reference][2]).This linter complain each time it found any captured loop variable inside a function closure. This linter is helpful if you have utilities that abstracts the
go
behavior, for example:will pass the
go vet
's check while fails thenoloopclosure
check.It's generally a good idea (unless every bit of performance matters) to extract the function creation part inside your
loop so that you don't accidentally capture the reference and cause unwanted bugs.
For example, code above can be re-written as:
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.