aboutsummaryrefslogtreecommitdiff
path: root/http_server.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-11-11 13:33:11 +0700
committerShulhan <ms@kilabit.info>2023-11-11 13:34:43 +0700
commit08852664aa6952e727addb0c24ad8f56274e09bb (patch)
treed4f59e9000a2676bf1c5952c0cbeb6a5ff1f7443 /http_server.go
parente56ee3e03a34fa738b626a4fd22fbc051bf7f0b0 (diff)
downloadgorankusu-08852664aa6952e727addb0c24ad8f56274e09bb.tar.xz
Makefile: replace the Go linter and apply all their recommendations
Previously, we use golangci-lint as linter. This linter does not provides any useful recommendation lately and the development is quite a mess, sometimes its break when using Go tip. In this changes we replace it with revive, fieldalignment, and shadow; and fix all of their recommendations.
Diffstat (limited to 'http_server.go')
-rw-r--r--http_server.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/http_server.go b/http_server.go
index d737352..4b89358 100644
--- a/http_server.go
+++ b/http_server.go
@@ -160,7 +160,7 @@ func (trunks *Trunks) initHttpServer(isDevelopment bool) (err error) {
}
// apiEnvironmentGet get the Trunks environment including its state.
-func (trunks *Trunks) apiEnvironmentGet(epr *libhttp.EndpointRequest) (resbody []byte, err error) {
+func (trunks *Trunks) apiEnvironmentGet(_ *libhttp.EndpointRequest) (resbody []byte, err error) {
res := libhttp.EndpointResponse{}
res.Code = http.StatusOK
res.Data = trunks.Env
@@ -228,7 +228,7 @@ func (trunks *Trunks) apiAttackHttp(epr *libhttp.EndpointRequest) (resbody []byt
// Response codes,
// - 200 OK: success, return the RunRequest object that has been cancelled.
// - 500 ERR_INTERNAL: internal server error.
-func (trunks *Trunks) apiAttackHttpCancel(epr *libhttp.EndpointRequest) (resbody []byte, err error) {
+func (trunks *Trunks) apiAttackHttpCancel(_ *libhttp.EndpointRequest) (resbody []byte, err error) {
var (
logp = `apiAttackHttpCancel`
runRequest *RunRequest
@@ -298,7 +298,7 @@ func (trunks *Trunks) apiAttackResultGet(epr *libhttp.EndpointRequest) (resbody
return json.Marshal(&res)
}
-func (trunks *Trunks) apiNavLinks(epr *libhttp.EndpointRequest) (resbody []byte, err error) {
+func (trunks *Trunks) apiNavLinks(_ *libhttp.EndpointRequest) (resbody []byte, err error) {
res := libhttp.EndpointResponse{}
res.Code = http.StatusOK
res.Data = trunks.navLinks
@@ -355,7 +355,7 @@ func (trunks *Trunks) apiTargetRunWebSocket(epr *libhttp.EndpointRequest) ([]byt
return json.Marshal(&epres)
}
-func (trunks *Trunks) apiTargets(epr *libhttp.EndpointRequest) (resbody []byte, err error) {
+func (trunks *Trunks) apiTargets(_ *libhttp.EndpointRequest) (resbody []byte, err error) {
res := libhttp.EndpointResponse{}
res.Code = http.StatusOK
res.Data = trunks.targets