Skip to content

Commit

Permalink
Merge pull request #27 from praetorian-inc/golint-fix
Browse files Browse the repository at this point in the history
golint fix
  • Loading branch information
praetorian-thendrickson committed Nov 6, 2023
2 parents 6a7276c + ed27f5b commit 81636c4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions pkg/plugins/services/rdp/rdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions pkg/scan/simple_scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 81636c4

Please sign in to comment.