gomplate icon indicating copy to clipboard operation
gomplate copied to clipboard

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

Open cofiem opened this issue 1 year ago • 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]

https://github.com/hairyhenderson/gomplate/blob/19cd050be438f9d407800725f16139d8a5f86624/docs-src/content/functions/coll.yml#L403-L407

https://github.com/hairyhenderson/gomplate/blob/19cd050be438f9d407800725f16139d8a5f86624/docs/content/functions/coll.md?plain=1#L621-L625

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?

cofiem avatar Jul 18 '24 04:07 cofiem

Looks like #2217 will fix this

hairyhenderson avatar Sep 02 '24 15:09 hairyhenderson

This issue is stale because it has been open for 60 days with no activity. If it is no longer relevant or necessary, please close it. Given no action, it will be closed in 14 days.

If it's still relevant, one of the following will remove the stale marking:

  • A maintainer can add this issue to a milestone to indicate that it's been accepted and will be worked on
  • A maintainer can remove the stale label
  • Anyone can post an update or other comment

github-actions[bot] avatar Nov 02 '24 04:11 github-actions[bot]