Skip to content

Commit

Permalink
Enhanced the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
parth-dadhaniya committed Mar 15, 2024
1 parent 8a39428 commit b63bb0a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/ottl/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,7 @@ func (g StandardPMapGetter[K]) Get(ctx context.Context, tCtx K) (pcommon.Map, er
case string:
var jsonData pcommon.Map
errUnmarshal := json.Unmarshal([]byte(val.(string)), &jsonData)
if errUnmarshal != nil {
return pcommon.Map{}, errUnmarshal
}
return jsonData, nil
return jsonData, errUnmarshal
default:
return pcommon.Map{}, TypeError(fmt.Sprintf("expected pcommon.Map but got %T", val))
}
Expand Down

0 comments on commit b63bb0a

Please sign in to comment.