clarify return type on ParseIP

This commit is contained in:
sm
2017-05-24 13:28:07 -07:00
parent 8dc7ae519f
commit 899329aa54
+3
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 {