X7ROOT File Manager
Current Path:
/opt/golang/1.22.0/src/reflect
opt
/
golang
/
1.22.0
/
src
/
reflect
/
📁
..
📄
abi.go
(15.02 KB)
📄
abi_test.go
(26.39 KB)
📄
all_test.go
(214.57 KB)
📄
arena.go
(570 B)
📄
asm_386.s
(1.07 KB)
📄
asm_amd64.s
(2.76 KB)
📄
asm_arm.s
(1.13 KB)
📄
asm_arm64.s
(2.77 KB)
📄
asm_loong64.s
(2.87 KB)
📄
asm_mips64x.s
(1.16 KB)
📄
asm_mipsx.s
(1.16 KB)
📄
asm_ppc64x.s
(3.31 KB)
📄
asm_riscv64.s
(2.58 KB)
📄
asm_s390x.s
(1.1 KB)
📄
asm_wasm.s
(1.15 KB)
📄
benchmark_test.go
(8.82 KB)
📄
deepequal.go
(7.42 KB)
📄
example_test.go
(4.53 KB)
📄
export_test.go
(3.73 KB)
📄
float32reg_generic.go
(681 B)
📄
float32reg_ppc64x.s
(838 B)
📄
float32reg_riscv64.s
(794 B)
📁
internal
📄
makefunc.go
(5.91 KB)
📄
nih_test.go
(1004 B)
📄
set_test.go
(5.71 KB)
📄
stubs_ppc64x.go
(292 B)
📄
stubs_riscv64.go
(263 B)
📄
swapper.go
(2 KB)
📄
tostring_test.go
(2.14 KB)
📄
type.go
(80.47 KB)
📄
type_test.go
(1.26 KB)
📄
value.go
(118.95 KB)
📄
visiblefields.go
(2.97 KB)
📄
visiblefields_test.go
(5.27 KB)
Editing: nih_test.go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build cgo package reflect_test import ( . "reflect" "runtime/cgo" "testing" "unsafe" ) type nih struct { _ cgo.Incomplete x int } var global_nih = nih{x: 7} func TestNotInHeapDeref(t *testing.T) { // See issue 48399. v := ValueOf((*nih)(nil)) v.Elem() shouldPanic("reflect: call of reflect.Value.Field on zero Value", func() { v.Elem().Field(0) }) v = ValueOf(&global_nih) if got := v.Elem().Field(1).Int(); got != 7 { t.Fatalf("got %d, want 7", got) } v = ValueOf((*nih)(unsafe.Pointer(new(int)))) shouldPanic("reflect: reflect.Value.Elem on an invalid notinheap pointer", func() { v.Elem() }) shouldPanic("reflect: reflect.Value.Pointer on an invalid notinheap pointer", func() { v.Pointer() }) shouldPanic("reflect: reflect.Value.UnsafePointer on an invalid notinheap pointer", func() { v.UnsafePointer() }) }
Upload File
Create Folder