mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-18 15:12:36 +00:00
In Hugo `0.49` we improved type support in `slice`. This has an unfortunate side effect in that `resources.Concat` now expects something that can resolve to `resource.Resources`. This worked for most situations, but when you try to `slice` different `Resource` objects, you would be getting `[]interface {}` and not `resource.Resources`. And `concat` would fail: ```bash error calling Concat: slice []interface {} not supported in concat. ``` This commit fixes that by simplifying the type checking logic in `Slice`: * If the first item implements the `Slicer` interface, we try that * If the above fails or the first item does not implement `Slicer`, we just return the `[]interface {}` Fixes #5269 |
||
---|---|---|
.. | ||
cast | ||
collections | ||
compare | ||
crypto | ||
data | ||
encoding | ||
fmt | ||
images | ||
inflect | ||
internal | ||
lang | ||
math | ||
os | ||
partials | ||
path | ||
resources | ||
safe | ||
strings | ||
templates | ||
time | ||
tplimpl | ||
transform | ||
urls | ||
template.go |