aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorTeddy Wing2023-05-14 21:21:06 +0200
committerTeddy Wing2023-05-14 21:26:36 +0200
commit6d91d473f24d6825170e494852b26ffc748fe542 (patch)
treeb4d5ec4ca1f1a46390407b0023eebfe6232ca2b2 /cmd
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 'cmd')
-rw-r--r--cmd/gocapturedrefrace/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/gocapturedrefrace/main.go b/cmd/gocapturedrefrace/main.go
new file mode 100644
index 0000000..d637a38
--- /dev/null
+++ b/cmd/gocapturedrefrace/main.go
@@ -0,0 +1,10 @@
+package main
+
+import (
+ "git.teddywing.com/gocapturedrefrace"
+ "golang.org/x/tools/go/analysis/singlechecker"
+)
+
+func main() {
+ singlechecker.Main(gocapturedrefrace.Analyzer)
+}