mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
common: Fix elements are doubling when append a not assignable type
Fixes #6188
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
096a4b67b9
commit
a9762b5c48
@@ -65,6 +65,7 @@ func Append(to interface{}, from ...interface{}) (interface{}, error) {
|
||||
fv := reflect.ValueOf(f)
|
||||
if !fv.Type().AssignableTo(tot) {
|
||||
// Fall back to a []interface{} slice.
|
||||
tov, _ := indirect(reflect.ValueOf(to))
|
||||
return appendToInterfaceSlice(tov, from...)
|
||||
}
|
||||
tov = reflect.Append(tov, fv)
|
||||
|
Reference in New Issue
Block a user