Skip to content

Commit

Permalink
Changed TagFilterDropAll to use pointer receivers
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <[email protected]>
  • Loading branch information
joe-elliott committed Nov 11, 2019
1 parent e016a3c commit 2946e14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@ type TagFilterDropAll struct {
}

// NewTagFilterDropAll return a filter that filters all of the specified type
func NewTagFilterDropAll(dropTags bool, dropProcessTags bool, dropLogs bool) TagFilterDropAll {
return TagFilterDropAll{
func NewTagFilterDropAll(dropTags bool, dropProcessTags bool, dropLogs bool) *TagFilterDropAll {
return &TagFilterDropAll{
dropTags: dropTags,
dropProcessTags: dropProcessTags,
dropLogs: dropLogs,
}
}

// FilterProcessTags implements TagFilter
func (f TagFilterDropAll) FilterProcessTags(span *model.Span, processTags model.KeyValues) model.KeyValues {
func (f *TagFilterDropAll) FilterProcessTags(span *model.Span, processTags model.KeyValues) model.KeyValues {
if f.dropProcessTags {
return model.KeyValues{}
}
return processTags
}

// FilterTags implements TagFilter
func (f TagFilterDropAll) FilterTags(span *model.Span, tags model.KeyValues) model.KeyValues {
func (f *TagFilterDropAll) FilterTags(span *model.Span, tags model.KeyValues) model.KeyValues {
if f.dropTags {
return model.KeyValues{}
}
return tags
}

// FilterLogFields implements TagFilter
func (f TagFilterDropAll) FilterLogFields(span *model.Span, logFields model.KeyValues) model.KeyValues {
func (f *TagFilterDropAll) FilterLogFields(span *model.Span, logFields model.KeyValues) model.KeyValues {
if f.dropLogs {
return model.KeyValues{}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestDropAll(t *testing.T) {
}

tt := []struct {
filter TagFilterDropAll
filter *TagFilterDropAll
expectedTags model.KeyValues
expectedProcessTags model.KeyValues
expectedLogs model.KeyValues
Expand Down

0 comments on commit 2946e14

Please sign in to comment.