From 8cef6b8da1c34d36b75980074d72b96d9d79c8a1 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Mon, 4 Dec 2023 15:45:20 +0100 Subject: [PATCH] chore: add linter & add/remove some white spaces --- Makefile | 3 +++ api/v1/net_services_utils.go | 2 -- xdp/types.go | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2831789..4304027 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ build: docker: docker build -t bittwister . +lint: + golangci-lint run ./... + test-go: sudo go test -v ./... -count=1 -p=1 diff --git a/api/v1/net_services_utils.go b/api/v1/net_services_utils.go index 2301b04..00cfe2b 100644 --- a/api/v1/net_services_utils.go +++ b/api/v1/net_services_utils.go @@ -135,7 +135,6 @@ func netServiceStop(resp http.ResponseWriter, ns *netRestrictService) error { Slug: SlugServiceNotReady, Title: "Service stopped", }) - if err != nil { return fmt.Errorf("sendJSON failed: %w", err) } @@ -164,7 +163,6 @@ func netServiceStatus(resp http.ResponseWriter, ns *netRestrictService) error { Slug: statusSlug, Title: "Service status", }) - if err != nil { return fmt.Errorf("sendJSON failed: %w", err) } diff --git a/xdp/types.go b/xdp/types.go index a86843e..adeb792 100644 --- a/xdp/types.go +++ b/xdp/types.go @@ -27,7 +27,6 @@ type XdpObject struct { var xdpObject XdpObject func GetPreparedXdpObject(netInterfaceIndex int) (*XdpObject, error) { - xdpObject.mu.Lock() defer xdpObject.mu.Unlock()