Skip to content

Commit

Permalink
combine splits
Browse files Browse the repository at this point in the history
  • Loading branch information
0x1 committed Jan 9, 2024
1 parent e13afd4 commit 3e0a27d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/detectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ func findHosts(verify bool, hostnameMatches, portMatches [][]string) []string {
if verify {
var verifiedHosts []string
for _, host := range hosts {
hostname, port := strings.Split(host, ":")[0], strings.Split(host, ":")[1]
parts := strings.Split(host, ":")
hostname, port := parts[0], parts[1]
if postgresRunning(hostname, port) {
verifiedHosts = append(verifiedHosts, host)
}
Expand Down

0 comments on commit 3e0a27d

Please sign in to comment.