From 7038f88df988bfb05341078a525fe2e702069be2 Mon Sep 17 00:00:00 2001 From: Volodymyr Komarov Date: Mon, 9 Mar 2020 01:00:48 +0200 Subject: [PATCH] Linter fixes and configuration --- .golangci.yml | 6 ++++-- hosts.go | 1 + main.go | 8 ++++---- ports.go | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index bfc0be9..69ca7db 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,8 @@ service: analyzed-paths: - scanner/... - golangci-lint-version: 1.12.x + golangci-lint-version: 1.23.x prepare: - - sudo apt-get install libpcap-dev + - apt-get update && apt-get install -y libpcap-dev + suggested-changes: + disabled: true diff --git a/hosts.go b/hosts.go index 78abf9a..bb37293 100644 --- a/hosts.go +++ b/hosts.go @@ -13,6 +13,7 @@ type hostsCommand struct { Timeout int `short:"t" long:"timeout" default:"5" description:"Timeout in seconds to wait for ARP responses."` } +// Execute will run the command func (c *hostsCommand) Execute(_ []string) error { fmt.Printf("Scanning Hosts..\n") diff --git a/main.go b/main.go index ae7d653..f0fd881 100644 --- a/main.go +++ b/main.go @@ -33,11 +33,11 @@ func main() { if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp { os.Exit(0) return - } else { - fmt.Printf("Error: %v\n", err) - os.Exit(1) - return } + + fmt.Printf("Error: %v\n", err) + os.Exit(1) + return } os.Exit(0) diff --git a/ports.go b/ports.go index 07d7353..b8f53a7 100644 --- a/ports.go +++ b/ports.go @@ -7,6 +7,7 @@ import ( type portsCommand struct { } +// Execute will run the command func (c *portsCommand) Execute(_ []string) error { fmt.Printf("Scanning Ports..\n") return nil