File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ func (d *Decoder) resolveAlias(node ast.Node) ast.Node {
238
238
}
239
239
case * ast.AliasNode :
240
240
aliasName := n .Value .GetToken ().Value
241
- return d .anchorNodeMap [aliasName ]
241
+ return d .resolveAlias ( d . anchorNodeMap [aliasName ])
242
242
}
243
243
return node
244
244
}
Original file line number Diff line number Diff line change @@ -1905,6 +1905,7 @@ anchors:
1905
1905
map: &y
1906
1906
a: b
1907
1907
c: d
1908
+ d: *x
1908
1909
a: *x
1909
1910
b:
1910
1911
<<: *y
@@ -1920,7 +1921,16 @@ b:
1920
1921
if v .A != "hello" {
1921
1922
t .Fatal ("failed to unmarshal with alias" )
1922
1923
}
1923
- if len (v .B ) != 3 {
1924
+ if len (v .B ) != 4 {
1925
+ t .Fatal ("failed to unmarshal with alias" )
1926
+ }
1927
+ if v .B ["a" ] != "b" {
1928
+ t .Fatal ("failed to unmarshal with alias" )
1929
+ }
1930
+ if v .B ["c" ] != "d" {
1931
+ t .Fatal ("failed to unmarshal with alias" )
1932
+ }
1933
+ if v .B ["d" ] != "hello" {
1924
1934
t .Fatal ("failed to unmarshal with alias" )
1925
1935
}
1926
1936
}
You can’t perform that action at this time.
0 commit comments