They should probably replace that with 2 if statements to make the error path and the non-error path obvious:
if err != nil {
return nil, err
}
if match {
return rule, nil
}