aboutsummaryrefslogtreecommitdiff
path: root/internal/cmd
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-01-26 15:46:23 +0700
committerShulhan <ms@kilabit.info>2025-02-08 15:28:44 +0700
commit77e055b2e0da5d76ca6651020f0eb990a6787e88 (patch)
treeb32e4aae63c1e036140d592164a09423052139a1 /internal/cmd
parent3826603fb49edda796c2a5541b39b5bb00d3745c (diff)
downloadrescached-77e055b2e0da5d76ca6651020f0eb990a6787e88.tar.xz
internal/cmd/gocheck: add internal static analyzers
Instead of using binary fieldalignment and shadow, run them by creating command that call the same Analyzer internally. This analyzers help finding possible panic on httpd.go.
Diffstat (limited to 'internal/cmd')
-rw-r--r--internal/cmd/gocheck/main.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/cmd/gocheck/main.go b/internal/cmd/gocheck/main.go
new file mode 100644
index 0000000..956e790
--- /dev/null
+++ b/internal/cmd/gocheck/main.go
@@ -0,0 +1,17 @@
+// SPDX-FileCopyrightText: 2024 M. Shulhan <ms@kilabit.info>
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+// Program gocheck implement go static analysis using [Analyzer] that are not
+// included in the default go vet.
+// See package [lib/goanalysis] for more information.
+//
+// [Analyzer]: https://pkg.go.dev/golang.org/x/tools/go/analysis#hdr-Analyzer
+// [lib/goanalysis]: https://pkg.go.dev/git.sr.ht/~shulhan/pakakeh.go/lib/goanalysis/
+package main
+
+import "git.sr.ht/~shulhan/pakakeh.go/lib/goanalysis"
+
+func main() {
+ goanalysis.Check()
+}