Skip to content

Commit

Permalink
plugins/logs: remove unused lookup function
Browse files Browse the repository at this point in the history
This has been replaced with removeValue.

Signed-off-by: Charlie Egan <[email protected]>
  • Loading branch information
charlieegan3 committed Jan 7, 2025
1 parent 93ecdff commit dcdb45b
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions v1/plugins/logs/mask.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,30 +200,6 @@ func (r maskRule) Mask(event *EventV1) error {
return nil
}

func (r maskRule) lookup(p []string, node interface{}) (interface{}, error) {
for i := 0; i < len(p); i++ {
switch v := node.(type) {
case map[string]interface{}:
var ok bool
if node, ok = v[p[i]]; !ok {
return nil, errMaskInvalidObject
}
case []interface{}:
idx, err := strconv.Atoi(p[i])
if err != nil {
return nil, errMaskInvalidObject
} else if idx < 0 || idx >= len(v) {
return nil, errMaskInvalidObject
}
node = v[idx]
default:
return nil, errMaskInvalidObject
}
}

return node, nil
}

func (r maskRule) removeValue(p []string, node interface{}) error {
if len(p) == 0 {
return nil
Expand Down

0 comments on commit dcdb45b

Please sign in to comment.