common/maps: Improve append in Scratch
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 8 Oct 2018 08:25:15 +0000 (10:25 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 8 Oct 2018 10:30:50 +0000 (12:30 +0200)
commit31a8bb8c071c6f2ca8cbd73057912932a1e7e943
tree698f8d82cf1dc2bb6c56ba3a615ef4b441361c6a
parent8e825ddf5b31ce5fe570c78ac7a78c8056fb60f9
common/maps: Improve append in Scratch

This commit consolidates the reflective collections handling in `.Scratch` vs the `tpl` package so they use the same code paths.

This commit also adds support for a corner case where a typed slice is appended to a nil or empty `[]interface{}`.

Fixes #5275
12 files changed:
common/collections/append.go [new file with mode: 0644]
common/collections/append_test.go [new file with mode: 0644]
common/collections/collections.go
common/collections/slice.go [new file with mode: 0644]
common/collections/slice_test.go [new file with mode: 0644]
common/maps/scratch.go
common/maps/scratch_test.go
tpl/collections/append.go
tpl/collections/append_test.go
tpl/collections/apply.go
tpl/collections/collections.go
tpl/collections/collections_test.go