Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
george pogosyan committed Aug 1, 2024
1 parent 1c2b486 commit 2e0d3ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tests-offsets
testdata

.idea/
.DS_Store
6 changes: 6 additions & 0 deletions plugin/action/remove_fields/remove_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ func (p *Plugin) Start(config pipeline.AnyConfig, _ *pipeline.ActionPluginParams
logger.Panicf("config is nil for the remove fields plugin")
}

// remove nested fields selection;
// for example:
// config `fields: ["a", "a.b"]` is equal to
// config `fields: ["a"]`
// see tests: TestDuplicatingFieldSelectors, TestNestedFieldSelectors

fields := p.config.Fields
sort.Slice(fields, func(i, j int) bool {
return len(fields[i]) < len(fields[j])
Expand Down

0 comments on commit 2e0d3ef

Please sign in to comment.