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

Unexpected result appending a slice to a slice of slices #11004

Closed
jmooring opened this issue May 23, 2023 · 2 comments
Closed

Unexpected result appending a slice to a slice of slices #11004

jmooring opened this issue May 23, 2023 · 2 comments
Assignees
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented May 23, 2023

{{ $obj := slice (slice "a") }}
{{ $obj = $obj | append (slice "b") }}
{{ $obj = $obj | append (slice "c") }}

<pre>
{{ jsonify (dict "indent" "  ") $obj }}
</pre>

Actual:

[
  [
    "a"
  ],
  "b",    <-- ???
  [
    "c"
  ]
]

Expected:

[
  [
    "a"
  ],
  [
    "b"
  ],
  [
    "c"
  ]
]

This isn’t new behavior (for example, reproduced with v0.76.0).

Not sure if this append issue is related: #10458.

Reference: https://discourse.gohugo.io/t/44501

@jmooring
Copy link
Member Author

Fixed with cefe74d.

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants