reflect: implement Value.Grow

This was added in Go 1.20 and becomes necessary for encoding/json in Go
1.21.
This commit is contained in:
Ayke van Laethem
2023-07-06 13:00:18 +02:00
committed by Ron Evans
parent 9126b95737
commit e98dfd6c46
2 changed files with 28 additions and 8 deletions
+2 -2
View File
@@ -790,6 +790,8 @@ func TestFunctionValue(t *testing.T) {
assert(t, v.Type().String(), "func()")
}
*/
func TestGrow(t *testing.T) {
v := ValueOf([]int(nil))
shouldPanic("reflect.Value.Grow using unaddressable value", func() { v.Grow(0) })
@@ -857,8 +859,6 @@ func TestGrow(t *testing.T) {
})
}
*/
var appendTests = []struct {
orig, extra []int
}{