diff options
| author | Shulhan <ms@kilabit.info> | 2025-02-03 18:28:15 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-02-03 20:11:07 +0700 |
| commit | a6d3b0944f80f7b84ac91f1904d23a312fbee098 (patch) | |
| tree | ceb793e048d97443595bbec18cc85cae7d5ef64d | |
| parent | b28176b259cc8056b4d3fa1088ee68a6d9294583 (diff) | |
| download | gorankusu-a6d3b0944f80f7b84ac91f1904d23a312fbee098.tar.xz | |
all: replace external linters with internal
The fieldalignment and shadow is linter from golang.org/x/tools.
This linters actually have an API that can be combined into a program,
which provided by package "pakakeh.go/lib/goanalysis".
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | go.mod | 1 | ||||
| -rw-r--r-- | go.sum | 2 | ||||
| -rw-r--r-- | gorankusu.go | 2 | ||||
| -rw-r--r-- | internal/cmd/gocheck/main.go | 17 |
5 files changed, 22 insertions, 5 deletions
@@ -10,14 +10,11 @@ all: lint test build .PHONY: init init: git submodule update --init - go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment - go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow cd _www && yarn install .PHONY: lint lint: lint-www - -fieldalignment ./... - -shadow ./... + go run ./internal/cmd/gocheck ./... go vet ./... .PHONY: lint-www @@ -23,6 +23,7 @@ require ( github.com/yuin/goldmark v1.7.8 // indirect github.com/yuin/goldmark-meta v1.1.0 // indirect golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect + golang.org/x/mod v0.22.0 // indirect golang.org/x/net v0.34.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.29.0 // indirect @@ -42,6 +42,8 @@ github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBv golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c h1:KL/ZBHXgKGVmuZBZ01Lt57yE5ws8ZPSkkihmEyq7FXc= golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbDrEGzRav+ilXA7PCRAd6xsmwiU= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/gorankusu.go b/gorankusu.go index 7dd041c..02fb8c8 100644 --- a/gorankusu.go +++ b/gorankusu.go @@ -72,7 +72,7 @@ func (gorankusu *Gorankusu) AttackHTTP(req *RunRequest) (err error) { } var origHTTPTarget = origTarget.getHTTPTarget(req.HTTPTarget.ID) - if origTarget == nil { + if origHTTPTarget == nil { return errInvalidHTTPTarget(req.HTTPTarget.ID) } if !origHTTPTarget.AllowAttack { 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() +} |
