func (b *Bridge) addImports(imps *wasmer.Imports) error {

	var is = []struct {
		space string
		name  string
		imp   interface{}
		cgo   unsafe.Pointer
	}{
		{"wasi_unstable", "fd_write", fdWrite, nil},
		{"env", "runtime.ticks", runtimeTicks, C.runtimeTicks},
		{"env", "runtime.sleepTicks", runtimeSleepTicks, C.runtimeSleepTicks},
		{"env", "syscall/js.stringVal", stringVal, C.stringVal},
		{"env", "syscall/js.valueGet", valueGet, C.valueGet},
		{"env", "syscall/js.valueSet", valueSet, C.valueSet},
		{"env", "syscall/js.valueIndex", valueIndex, nil},
		{"env", "syscall/js.valueSetIndex", valueSetIndex, nil},
		{"env", "syscall/js.valueCall", valueCall, C.valueCall},
		{"env", "syscall/js.valueNew", valueNew, C.valueNew},
		{"env", "syscall/js.valueLength", valueLength, nil},
		{"env", "syscall/js.valuePrepareString", valuePrepareString, C.valuePrepareString},
		{"env", "syscall/js.valueLoadString", valueLoadString, C.valueLoadString},
	}
	for _, imp := range is {
		imps = imps.Namespace(imp.space)
		imps, _ = imps.Append(imp.name, imp.imp, imp.cgo)
	}
	return nil
}
// addImports adds go Bridge imports in "go" namespace.
addImports adds go Bridge imports in "go" namespace.
// addImports adds go Bridge imports in " go " namespace .
func (b *Bridge) addImports(imps *wasmer.Imports) error {
	var is = []struct {
		space string
		name  string
		imp   interface{}
		cgo   unsafe.Pointer
	}{
		{"wasi_unstable", "fd_write", fdWrite, nil},
		{"env", "runtime.ticks", runtimeTicks, C.runtimeTicks},
		{"env", "runtime.sleepTicks", runtimeSleepTicks, C.runtimeSleepTicks},
		{"env", "syscall/js.stringVal", stringVal, C.stringVal},
		{"env", "syscall/js.valueGet", valueGet, C.valueGet},
		{"env", "syscall/js.valueSet", valueSet, C.valueSet},
		{"env", "syscall/js.valueIndex", valueIndex, nil},
		{"env", "syscall/js.valueSetIndex", valueSetIndex, nil},
		{"env", "syscall/js.valueCall", valueCall, C.valueCall},
		{"env", "syscall/js.valueNew", valueNew, C.valueNew},
		{"env", "syscall/js.valueLength", valueLength, nil},
		{"env", "syscall/js.valuePrepareString", valuePrepareString, C.valuePrepareString},
		{"env", "syscall/js.valueLoadString", valueLoadString, C.valueLoadString},
	}
	for _, imp := range is {
		imps = imps.Namespace(imp.space)
		imps, _ = imps.Append(imp.name, imp.imp, imp.cgo)
	}
	return nil
}
func ( b * Bridge ) addImports ( imps * wasmer . Imports ) error { var is = [ ] struct { space string name string imp interface { } cgo unsafe . Pointer } { { " " , " " , fdWrite , nil } , { " " , " " , runtimeTicks , C . runtimeTicks } , { " " , " " , runtimeSleepTicks , C . runtimeSleepTicks } , { " " , " " , stringVal , C . stringVal } , { " " , " " , valueGet , C . valueGet } , { " " , " " , valueSet , C . valueSet } , { " " , " " , valueIndex , nil } , { " " , " " , valueSetIndex , nil } , { " " , " " , valueCall , C . valueCall } , { " " , " " , valueNew , C . valueNew } , { " " , " " , valueLength , nil } , { " " , " " , valuePrepareString , C . valuePrepareString } , { " " , " " , valueLoadString , C . valueLoadString } , } for _ , imp := range is { imps = imps . Namespace ( imp . space ) imps , _ = imps . Append ( imp . name , imp . imp , imp . cgo ) } return nil }
addImports adds go Bridge imports in "go" namespace.
addImports adds go Bridge imports in " go " namespace .