clarify return type on ParseIP

This commit is contained in:
Stephen McQuay 2017-05-24 13:28:07 -07:00
parent 8dc7ae519f
commit 899329aa54
No known key found for this signature in database
GPG Key ID: 1ABF428F71BAFC3D
1 changed files with 3 additions and 0 deletions

3
ips.go
View File

@ -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 {