Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the second example for coll.Merge incorrect? #2182

Closed
cofiem opened this issue Jul 18, 2024 · 2 comments · Fixed by #2252
Closed

Is the second example for coll.Merge incorrect? #2182

cofiem opened this issue Jul 18, 2024 · 2 comments · Fixed by #2252
Labels

Comments

@cofiem
Copy link

cofiem commented Jul 18, 2024

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?

@hairyhenderson
Copy link
Owner

Looks like #2217 will fix this

Copy link

github-actions bot commented Nov 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants