aboutsummaryrefslogtreecommitdiffstats
path: root/testdata/function_argument.go
diff options
context:
space:
mode:
authorTeddy Wing2023-05-17 19:32:22 +0200
committerTeddy Wing2023-05-17 19:32:22 +0200
commit52dbd96539f74b180c11c7ed1e2c83ed49c3f8bc (patch)
tree545eb38a288604f5302f7741d8814d39adf450a9 /testdata/function_argument.go
parent30108b1bd18392588d4744a75658360eb18bd8e9 (diff)
downloadgocapturedrefrace-52dbd96539f74b180c11c7ed1e2c83ed49c3f8bc.tar.bz2
function_argument: Add a test for local function variables
Diffstat (limited to 'testdata/function_argument.go')
-rw-r--r--testdata/function_argument.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/testdata/function_argument.go b/testdata/function_argument.go
index 5a38ae2..db21eae 100644
--- a/testdata/function_argument.go
+++ b/testdata/function_argument.go
@@ -5,3 +5,11 @@ func functionArgument(callback func()) {
callback()
}()
}
+
+func functionVariable() {
+ callback := func() int { return 0; }
+
+ go func() {
+ callback()
+ }()
+}