From 08852664aa6952e727addb0c24ad8f56274e09bb Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 11 Nov 2023 13:33:11 +0700 Subject: 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. --- http_server.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'http_server.go') 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 -- cgit v1.3