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>
Wed, 10 Oct 2018 10:21:51 +0000 (12:21 +0200)
commit23f48c300cb5ffe0fe43c88464f38c68831a17ad
tree53207e3f137fac63f00fcc175b74ac78a2d8a106
parente2201ef15fdefe257ad284b2df4ccc8f8c38fac2
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