clarify return type on ParseIP
This commit is contained in:
parent
8dc7ae519f
commit
899329aa54
3
ips.go
3
ips.go
@ -10,6 +10,9 @@ var p = regexp.MustCompile(`Failed password for .* from (.*) port`)
|
||||
|
||||
// ParseIP finds the ip address from an sshd log line that contains a failed
|
||||
// password attempt.
|
||||
//
|
||||
// A found IP address will be returned; an empty string returned indicates
|
||||
// nothing was found.
|
||||
func ParseIP(line string) string {
|
||||
if m := p.FindStringSubmatch(line); m != nil {
|
||||
if len(m) != 2 {
|
||||
|
Loading…
Reference in New Issue
Block a user