From ed27f5bf5ebbd8b420901b714d586b57b445ee10 Mon Sep 17 00:00:00 2001 From: Thomas Hendrickson Date: Mon, 6 Nov 2023 11:09:02 -0500 Subject: [PATCH] golint fix --- .golangci.yml | 2 +- pkg/plugins/services/rdp/rdp.go | 6 ++---- pkg/scan/simple_scan.go | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 442c384..b4366da 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -288,7 +288,7 @@ linters-settings: gofumpt: # Select the Go version to target. The default is `1.15`. - lang-version: "1.18.2" + lang-version: "1.20" # Choose whether or not to use the extra rules that are disabled # by default diff --git a/pkg/plugins/services/rdp/rdp.go b/pkg/plugins/services/rdp/rdp.go index 48119c9..663f1b8 100644 --- a/pkg/plugins/services/rdp/rdp.go +++ b/pkg/plugins/services/rdp/rdp.go @@ -347,9 +347,8 @@ func (p *RDPPlugin) Run(conn net.Conn, timeout time.Duration, target plugins.Tar OSFingerprint: fingerprint, } return plugins.CreateServiceFrom(target, payload, false, "", plugins.TCP), nil - } else { - return nil, err } + return nil, err } func (p *TLSPlugin) Run(conn net.Conn, timeout time.Duration, target plugins.Target) (*plugins.Service, error) { @@ -358,9 +357,8 @@ func (p *TLSPlugin) Run(conn net.Conn, timeout time.Duration, target plugins.Tar return nil, nil } else if check && info != nil && err == nil { return plugins.CreateServiceFrom(target, *info, true, "", plugins.TCP), nil - } else { - return nil, err } + return nil, err } func (p *RDPPlugin) Name() string { diff --git a/pkg/scan/simple_scan.go b/pkg/scan/simple_scan.go index 37ecb2e..2066907 100644 --- a/pkg/scan/simple_scan.go +++ b/pkg/scan/simple_scan.go @@ -137,8 +137,8 @@ func (c *Config) SimpleScanTarget(target plugins.Target) (*plugins.Service, erro } } - tlsConn, err := DialTLS(target) - isTLS := err == nil + tlsConn, tlsErr := DialTLS(target) + isTLS := tlsErr == nil if isTLS { for _, plugin := range sortedTCPTLSPlugins { if plugin.PortPriority(port) { @@ -167,7 +167,7 @@ func (c *Config) SimpleScanTarget(target plugins.Target) (*plugins.Service, erro if isTLS { for _, plugin := range sortedTCPTLSPlugins { - tlsConn, err = DialTLS(target) + tlsConn, err := DialTLS(target) if err != nil { return nil, fmt.Errorf("error connecting via TLS, err = %w", err) }