From 8f0ddc114a61cec9c49cb5c754ac225ea7b03513 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 15 May 2023 02:29:40 +0200 Subject: testdata/simple.go: Find out what happens when var is reused Second usage of captured reference is reported as expected. That seems correct for our needs. --- testdata/simple.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'testdata') diff --git a/testdata/simple.go b/testdata/simple.go index 4b4c23a..dd9f74e 100644 --- a/testdata/simple.go +++ b/testdata/simple.go @@ -7,5 +7,9 @@ func main() { go func() { capturedReference += 1 capturedReference2 += 1 + + if capturedReference == 1 { + return + } }() } -- cgit v1.2.3