aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--http_server_test.go10
-rw-r--r--internal/cmd/gocheck/main.go17
3 files changed, 20 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index f2f2ae7..46f5438 100644
--- a/Makefile
+++ b/Makefile
@@ -15,8 +15,7 @@ test:
.PHONY: lint
lint:
- -fieldalignment ./...
- -shadow ./...
+ go run ./internal/cmd/gocheck ./...
go vet ./...
## embed convert the TypeScript files into JavaScript and embed all _wui
diff --git a/http_server_test.go b/http_server_test.go
index 2dcd94f..8617c65 100644
--- a/http_server_test.go
+++ b/http_server_test.go
@@ -55,10 +55,7 @@ func TestHttpServer_Decrypt(t *testing.T) {
}
var endpointDecrypt = &libhttp.Endpoint{
- Method: libhttp.RequestMethodPost,
- Path: pathAwwanAPIDecrypt,
- RequestType: libhttp.RequestTypeJSON,
- ResponseType: libhttp.ResponseTypeJSON,
+ Path: pathAwwanAPIDecrypt,
}
var cases = []testCase{{
@@ -142,10 +139,7 @@ func TestHttpServer_Encrypt(t *testing.T) {
}
var endpointEncrypt = &libhttp.Endpoint{
- Method: libhttp.RequestMethodPost,
- Path: pathAwwanAPIEncrypt,
- RequestType: libhttp.RequestTypeJSON,
- ResponseType: libhttp.ResponseTypeJSON,
+ Path: pathAwwanAPIEncrypt,
}
var cases = []testCase{{
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()
+}