mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated integration tests
This commit is contained in:
committed by
Dan Christian Bogos
parent
b8437f4a7d
commit
fc2f7631bd
@@ -115,6 +115,9 @@ func (n *DataNode) Field(path []string) (*DataLeaf, error) {
|
||||
if len(path) == 0 {
|
||||
return nil, ErrWrongPath
|
||||
}
|
||||
if path[0] == Length {
|
||||
return &DataLeaf{Data: len(n.Slice)}, nil
|
||||
}
|
||||
idx, err := strconv.Atoi(path[0]) // convert the path to index
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -154,6 +157,9 @@ func (n *DataNode) fieldAsInterface(path []string) (interface{}, error) {
|
||||
if len(path) == 0 {
|
||||
return n.Slice, nil
|
||||
}
|
||||
if path[0] == Length {
|
||||
return len(n.Slice), nil
|
||||
}
|
||||
idx, err := strconv.Atoi(path[0]) // convert the path to index
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user