From 4f6d598ea88f6afe47ceb9611d5e854c522e55b2 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 28 Mar 2021 22:31:27 +0200 Subject: reflect: implement Sizeof and Alignof for func values This is a small change that appears to be necessary for encoding/json support. It's simple enough to implement. --- testdata/reflect.go | 1 + 1 file changed, 1 insertion(+) (limited to 'testdata') diff --git a/testdata/reflect.go b/testdata/reflect.go index 2ddbe8dd7..b02dd6c80 100644 --- a/testdata/reflect.go +++ b/testdata/reflect.go @@ -148,6 +148,7 @@ func main() { assertSize(reflect.TypeOf(uintptr(0)).Size() == unsafe.Sizeof(uintptr(0)), "uintptr") assertSize(reflect.TypeOf("").Size() == unsafe.Sizeof(""), "string") assertSize(reflect.TypeOf(new(int)).Size() == unsafe.Sizeof(new(int)), "*int") + assertSize(reflect.TypeOf(zeroFunc).Size() == unsafe.Sizeof(zeroFunc), "func()") // SetBool rv := reflect.ValueOf(new(bool)).Elem() -- cgit v1.2.3