[GODRIVER-2642] Enable the exportloopref linter Created: 02/Nov/22  Updated: 24/Jan/23  Resolved: 20/Nov/22

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.12.0, 1.12.0-alpha1

Type: Task Priority: Major - P3
Reporter: Benji Rewis (Inactive) Assignee: Benji Rewis (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to GODRIVER-2156 Enable all remaining golangci-lint li... Closed
Epic Link: Improve Testing Suite
Quarter: FY23Q4
Documentation Changes: Not Needed

 Description   

In parallelizing the test suite, I've found it's very easy to make the mistake of not capturing the for-loop variable when using t.Parallel(). This a really common issue for Go developers and will probably be changed in the language. Until then, we should use a linter like exportloopref to check for this error.



 Comments   
Comment by Githook User [ 20/Nov/22 ]

Author:

{'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}

Message: GODRIVER-2642 Enable the exportloopref linter. (#1134)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/766f8281c63d88369371f5b079e0381a75fc7953

Comment by Benji Rewis (Inactive) [ 17/Nov/22 ]

https://github.com/mongodb/mongo-go-driver/pull/1134

Generated at Thu Feb 08 08:39:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.