Skip to content

Commit

Permalink
Small fix for anon
Browse files Browse the repository at this point in the history
  • Loading branch information
felixge committed Sep 22, 2021
1 parent 034d66a commit 14575ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/pprofutils/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/peterbourgon/ff/v3 v3.1.0
github.com/philhofer/fwd v1.1.1 // indirect
github.com/wolfeidau/humanhash v1.1.0 // indirect
github.com/wolfeidau/humanhash v1.1.0
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
gopkg.in/DataDog/dd-trace-go.v1 v1.33.0
)
13 changes: 8 additions & 5 deletions utils/anon.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ func (a *Anon) Execute(ctx context.Context) error {
}

var whitelisted []*regexp.Regexp
for _, w := range strings.Split(a.Whitelist, ";") {
r, err := regexp.Compile(w)
if err != nil {
return err
wl := strings.TrimSpace(a.Whitelist)
if len(wl) > 0 {
for _, w := range strings.Split(wl, ";") {
r, err := regexp.Compile(w)
if err != nil {
return err
}
whitelisted = append(whitelisted, r)
}
whitelisted = append(whitelisted, r)
}

outer:
Expand Down

0 comments on commit 14575ac

Please sign in to comment.