refactor: move scrubber into its own package (#393)

Also part of https://github.com/ooni/probe/issues/1687
This commit is contained in:
Simone Basso 2021-06-22 14:08:29 +02:00 committed by GitHub
commit 75ae99e9d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View file

@ -8,6 +8,8 @@ import (
"fmt"
"regexp"
"strings"
"github.com/ooni/probe-cli/v3/internal/scrubber"
)
const (
@ -287,7 +289,7 @@ func toFailureString(err error) string {
return FailureGenericTimeoutError
}
formatted := fmt.Sprintf("unknown_failure: %s", s)
return Scrub(formatted) // scrub IP addresses in the error
return scrubber.Scrub(formatted) // scrub IP addresses in the error
}
func toOperationString(err error, operation string) string {