github.com/switchupcb/yaegi@v0.10.2/stdlib/go1_16_runtime.go (about)

     1  // Code generated by 'yaegi extract runtime'. DO NOT EDIT.
     2  
     3  // +build go1.16,!go1.17
     4  
     5  package stdlib
     6  
     7  import (
     8  	"go/constant"
     9  	"go/token"
    10  	"reflect"
    11  	"runtime"
    12  )
    13  
    14  func init() {
    15  	Symbols["runtime/runtime"] = map[string]reflect.Value{
    16  		// function, constant and variable definitions
    17  		"BlockProfile":            reflect.ValueOf(runtime.BlockProfile),
    18  		"Breakpoint":              reflect.ValueOf(runtime.Breakpoint),
    19  		"CPUProfile":              reflect.ValueOf(runtime.CPUProfile),
    20  		"Caller":                  reflect.ValueOf(runtime.Caller),
    21  		"Callers":                 reflect.ValueOf(runtime.Callers),
    22  		"CallersFrames":           reflect.ValueOf(runtime.CallersFrames),
    23  		"Compiler":                reflect.ValueOf(constant.MakeFromLiteral("\"gc\"", token.STRING, 0)),
    24  		"FuncForPC":               reflect.ValueOf(runtime.FuncForPC),
    25  		"GC":                      reflect.ValueOf(runtime.GC),
    26  		"GOARCH":                  reflect.ValueOf(runtime.GOARCH),
    27  		"GOMAXPROCS":              reflect.ValueOf(runtime.GOMAXPROCS),
    28  		"GOOS":                    reflect.ValueOf(runtime.GOOS),
    29  		"GOROOT":                  reflect.ValueOf(runtime.GOROOT),
    30  		"Goexit":                  reflect.ValueOf(runtime.Goexit),
    31  		"GoroutineProfile":        reflect.ValueOf(runtime.GoroutineProfile),
    32  		"Gosched":                 reflect.ValueOf(runtime.Gosched),
    33  		"KeepAlive":               reflect.ValueOf(runtime.KeepAlive),
    34  		"LockOSThread":            reflect.ValueOf(runtime.LockOSThread),
    35  		"MemProfile":              reflect.ValueOf(runtime.MemProfile),
    36  		"MemProfileRate":          reflect.ValueOf(&runtime.MemProfileRate).Elem(),
    37  		"MutexProfile":            reflect.ValueOf(runtime.MutexProfile),
    38  		"NumCPU":                  reflect.ValueOf(runtime.NumCPU),
    39  		"NumCgoCall":              reflect.ValueOf(runtime.NumCgoCall),
    40  		"NumGoroutine":            reflect.ValueOf(runtime.NumGoroutine),
    41  		"ReadMemStats":            reflect.ValueOf(runtime.ReadMemStats),
    42  		"ReadTrace":               reflect.ValueOf(runtime.ReadTrace),
    43  		"SetBlockProfileRate":     reflect.ValueOf(runtime.SetBlockProfileRate),
    44  		"SetCPUProfileRate":       reflect.ValueOf(runtime.SetCPUProfileRate),
    45  		"SetCgoTraceback":         reflect.ValueOf(runtime.SetCgoTraceback),
    46  		"SetFinalizer":            reflect.ValueOf(runtime.SetFinalizer),
    47  		"SetMutexProfileFraction": reflect.ValueOf(runtime.SetMutexProfileFraction),
    48  		"Stack":                   reflect.ValueOf(runtime.Stack),
    49  		"StartTrace":              reflect.ValueOf(runtime.StartTrace),
    50  		"StopTrace":               reflect.ValueOf(runtime.StopTrace),
    51  		"ThreadCreateProfile":     reflect.ValueOf(runtime.ThreadCreateProfile),
    52  		"UnlockOSThread":          reflect.ValueOf(runtime.UnlockOSThread),
    53  		"Version":                 reflect.ValueOf(runtime.Version),
    54  
    55  		// type definitions
    56  		"BlockProfileRecord": reflect.ValueOf((*runtime.BlockProfileRecord)(nil)),
    57  		"Error":              reflect.ValueOf((*runtime.Error)(nil)),
    58  		"Frame":              reflect.ValueOf((*runtime.Frame)(nil)),
    59  		"Frames":             reflect.ValueOf((*runtime.Frames)(nil)),
    60  		"Func":               reflect.ValueOf((*runtime.Func)(nil)),
    61  		"MemProfileRecord":   reflect.ValueOf((*runtime.MemProfileRecord)(nil)),
    62  		"MemStats":           reflect.ValueOf((*runtime.MemStats)(nil)),
    63  		"StackRecord":        reflect.ValueOf((*runtime.StackRecord)(nil)),
    64  		"TypeAssertionError": reflect.ValueOf((*runtime.TypeAssertionError)(nil)),
    65  
    66  		// interface wrapper definitions
    67  		"_Error": reflect.ValueOf((*_runtime_Error)(nil)),
    68  	}
    69  }
    70  
    71  // _runtime_Error is an interface wrapper for Error type
    72  type _runtime_Error struct {
    73  	IValue        interface{}
    74  	WError        func() string
    75  	WRuntimeError func()
    76  }
    77  
    78  func (W _runtime_Error) Error() string {
    79  	return W.WError()
    80  }
    81  func (W _runtime_Error) RuntimeError() {
    82  	W.WRuntimeError()
    83  }