hairyhenderson/gomplate

Is the second example for `coll.Merge` incorrect?

Opened this issue · 1 comments

The second example for coll.Merge:

$ gomplate -i '{{ $dst := dict "foo" 1 "bar" 2 }}
{{ $src1 := dict "foo" 8 "baz" 4 }}
{{ $src2 := dict "foo" 3 "bar" 5 }}
{{ coll.Merge $dst $src1 $src2 }}'
map[foo:1 bar:5 baz:4]

$ gomplate -i '{{ $dst := dict "foo" 1 "bar" 2 }}
{{ $src1 := dict "foo" 8 "baz" 4 }}
{{ $src2 := dict "foo" 3 "bar" 5 }}
{{ coll.Merge $dst $src1 $src2 }}'
map[foo:1 bar:5 baz:4]

$ gomplate -i '{{ $dst := dict "foo" 1 "bar" 2 }}
{{ $src1 := dict "foo" 8 "baz" 4 }}
{{ $src2 := dict "foo" 3 "bar" 5 }}
{{ coll.Merge $dst $src1 $src2 }}'
map[foo:1 bar:5 baz:4]

But using gomplate v4.1.0 I get:

$ gomplate -i '{{ $dst := dict "foo" 1 "bar" 2 }}
> {{ $src1 := dict "foo" 8 "baz" 4 }}
> {{ $src2 := dict "foo" 3 "bar" 5 }}
> {{ coll.Merge $dst $src1 $src2 }}'

map[bar:2 baz:4 foo:1]

The value for bar is 2?

Looks like #2217 will fix this