aboutsummaryrefslogtreecommitdiffstats
path: root/testdata
diff options
context:
space:
mode:
authorTeddy Wing2023-05-14 21:21:06 +0200
committerTeddy Wing2023-05-14 21:26:36 +0200
commit6d91d473f24d6825170e494852b26ffc748fe542 (patch)
treeb4d5ec4ca1f1a46390407b0023eebfe6232ca2b2 /testdata
parent27b71d7c8fdedca306885d078be5a35a39669907 (diff)
downloadgocapturedrefrace-6d91d473f24d6825170e494852b26ffc748fe542.tar.bz2
Find `go` statements using Go analyzer
Build a basic Go analyser that finds `go` statements. Currently testing this with: $ go run ./cmd/gocapturedrefrace ./testdata/ Using the following tutorials as a guide: * https://arslan.io/2019/06/13/using-go-analysis-to-write-a-custom-linter/ * https://scribe.rip/codex/writing-custom-linter-in-go-54ef6f8080
Diffstat (limited to 'testdata')
-rw-r--r--testdata/simple.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/testdata/simple.go b/testdata/simple.go
new file mode 100644
index 0000000..496be52
--- /dev/null
+++ b/testdata/simple.go
@@ -0,0 +1,9 @@
+package main
+
+func main() {
+ capturedReference := 0
+
+ go func() {
+ capturedReference += 1
+ }()
+}