diff options
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/reflect.go | 7 | ||||
-rw-r--r-- | testdata/reflect.txt | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/testdata/reflect.go b/testdata/reflect.go index f48683150..f36fcca73 100644 --- a/testdata/reflect.go +++ b/testdata/reflect.go @@ -347,6 +347,13 @@ func main() { println("errorValue.Implements(errorType) was true, expected false") } + println("\nalignment / offset:") + v2 := struct { + noCompare [0]func() + data byte + }{} + println("struct{[0]func(); byte}:", unsafe.Offsetof(v2.data) == uintptr(unsafe.Pointer(&v2.data))-uintptr(unsafe.Pointer(&v2))) + println("\nstruct tags") TestStructTag() diff --git a/testdata/reflect.txt b/testdata/reflect.txt index c07fc01d8..f2b455aa9 100644 --- a/testdata/reflect.txt +++ b/testdata/reflect.txt @@ -405,6 +405,9 @@ offset for int64 matches: true offset for complex128 matches: true type assertion succeeded for unreferenced type +alignment / offset: +struct{[0]func(); byte}: true + struct tags blue gopher |