github.com/jxskiss/gopkg/v2@v2.14.9-0.20240514120614-899f3e7952b4/easy/yamlx/testdata/ref_circular.yaml (about)

     1  obj1:
     2    foo: "bar"
     3  array: [ 1, 2, 3 ]
     4  # Reference to other values, wil be "bar"
     5  test_ref1: "@@ref obj1.foo"
     6  # Another reference, will be 3
     7  test_ref2: "@@ref array.2 "
     8  # Get length of "array", will be 3
     9  test_ref3: "@@ref   array.# "
    10  test_ref4:
    11    key1:
    12      key2: "@@ref test_ref1"
    13      key3:
    14        - "@@ref test_ref2"
    15        - "@@ref friends.#.age"
    16      key4: '@@ref  test_ref5  '
    17  friends:
    18    - first: Dale
    19      last: "@@ref test_ref4.key1.key2"
    20      age: 44
    21      nets: [ "ig", "fb", "tw" ]
    22    - first: Roger
    23      last: Craig
    24      age: '@@ref test_ref4.key1.key3 '
    25      nets: [ "fb", "tw" ]
    26    - first: Jane
    27      last: Murphy
    28      age: 47
    29      nets: [ "ig", "tw" ]
    30  # Will be [ "Dale","Roger","Jane" ]
    31  test_ref5: '@@ref friends.#.first'
    32  test_ref6:
    33    key1: '@@ref test_ref4.key1'