From 097aa96efcd47eb3aaaff17d34d36a1bec831ba9 Mon Sep 17 00:00:00 2001 From: odubajDT Date: Mon, 16 Dec 2024 16:06:47 +0100 Subject: [PATCH] remove dead code Signed-off-by: odubajDT --- pkg/ottl/contexts/ottllog/log.go | 12 ------------ pkg/ottl/expression.go | 5 ----- pkg/ottl/functions.go | 11 ----------- 3 files changed, 28 deletions(-) diff --git a/pkg/ottl/contexts/ottllog/log.go b/pkg/ottl/contexts/ottllog/log.go index 27469229dfee..3dde1bb851e6 100644 --- a/pkg/ottl/contexts/ottllog/log.go +++ b/pkg/ottl/contexts/ottllog/log.go @@ -237,18 +237,6 @@ func (pep *pathExpressionParser) parsePath(path ottl.Path[TransformContext]) (ot if path.Keys() == nil { return accessAttributes(), nil } - // p, err := path.Keys()[0].Path() - // if err != nil { - // return nil, err - // } - // var subGetter ottl.GetSetter[TransformContext] - // if p.Keys() != nil { - // s, err := pep.parsePath(p) - // if err != nil { - // return nil, err - // } - // subGetter = s - // } return accessAttributesKey(path.Keys()), nil case "dropped_attributes_count": return accessDroppedAttributesCount(), nil diff --git a/pkg/ottl/expression.go b/pkg/ottl/expression.go index 91d7cb7bdc32..a2e8d29e63c4 100644 --- a/pkg/ottl/expression.go +++ b/pkg/ottl/expression.go @@ -143,11 +143,6 @@ func (g exprGetter[K]) Get(ctx context.Context, tCtx K) (any, error) { default: return nil, fmt.Errorf("type, %T, does not support int indexing", result) } - case k.Path != nil: - // getter, err := p.newGetter(k.Path) - // if err != nil { - // return nil, err - // } default: return nil, fmt.Errorf("neither map nor slice index were set; this is an error in OTTL") } diff --git a/pkg/ottl/functions.go b/pkg/ottl/functions.go index adb103ae59f3..3ba4678e0b70 100644 --- a/pkg/ottl/functions.go +++ b/pkg/ottl/functions.go @@ -272,17 +272,6 @@ func (k *baseKey[K]) PathGetter() (GetSetter[K], error) { } func (p *Parser[K]) parsePath(ip *basePath[K]) (GetSetter[K], error) { - // path, err := ip.Keys()[0].Path() - // if err != nil { - // return nil, err - // } - // if p != nil { - // s, err := p.parsePath(path.(*basePath[K])) - // if err != nil { - // return nil, err - // } - - // } g, err := p.pathParser(ip) if err != nil { return nil, err