Skip to content

Commit

Permalink
adapt to recent changes in main
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
  • Loading branch information
bacherfl committed Nov 19, 2024
1 parent 56ea01c commit 070e376
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/ottl/ottlfuncs/func_flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ func flattenValue(k string, v pcommon.Value, currentDepth int64, maxDepth int64,
case v.Type() == pcommon.ValueTypeSlice && currentDepth < maxDepth:
for i := 0; i < v.Slice().Len(); i++ {
switch {
case v.Slice().At(i).Type() == pcommon.ValueTypeMap:
case v.Slice().At(i).Type() == pcommon.ValueTypeMap && currentDepth+1 < maxDepth:
flattenMap(v.Slice().At(i).Map(), result, fmt.Sprintf("%v.%v", prefix+k, i), currentDepth+2, maxDepth)
case v.Slice().At(i).Type() == pcommon.ValueTypeSlice:
case v.Slice().At(i).Type() == pcommon.ValueTypeSlice && currentDepth+1 < maxDepth:
flattenSlice(v.Slice().At(i).Slice(), result, fmt.Sprintf("%v.%v", prefix+k, i), currentDepth+2, maxDepth)
default:
v.Slice().At(i).CopyTo(result.PutEmpty(fmt.Sprintf("%v.%v", prefix+k, i)))
Expand Down

0 comments on commit 070e376

Please sign in to comment.