aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2023-05-17 19:29:42 +0200
committerTeddy Wing2023-05-17 19:29:42 +0200
commit30108b1bd18392588d4744a75658360eb18bd8e9 (patch)
tree4230847a8522f40e150ff5ab6fa36b7f704b0ac6
parent74097ae4882b4018267a70bee0c667312b9ce8e1 (diff)
downloadgocapturedrefrace-30108b1bd18392588d4744a75658360eb18bd8e9.tar.bz2
Add test for function arguments
Don't report captured function values: $ go test --- FAIL: Test (1.26s) analysistest.go:459: ./testdata/function_argument.go:5:3: unexpected diagnostic: captured reference callback in goroutine closure
-rw-r--r--testdata/function_argument.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/testdata/function_argument.go b/testdata/function_argument.go
new file mode 100644
index 0000000..5a38ae2
--- /dev/null
+++ b/testdata/function_argument.go
@@ -0,0 +1,7 @@
+package main
+
+func functionArgument(callback func()) {
+ go func() {
+ callback()
+ }()
+}