func GoClientCall(callHandle uint64) rpc.ClientCall { valptr := sutil.GoGetRef(callHandle) if call, ok := valptr.(rpc.ClientCall); ok { return call } else { panic(fmt.Sprintf("Couldn't get client call from handle with id %d", callHandle)) } }
// Converts a native pointer from Swift to a Go Discovery.T. Panics if it can't. func GoDiscoveryT(discoveryHandle uint64) discovery.T { valptr := util.GoGetRef(discoveryHandle) if d, ok := valptr.(*discovery.T); ok { return *d } else { panic(fmt.Sprintf("Couldn't get discovery.T from handle with id %d", discoveryHandle)) } }
// Converts a native pointer from Swift to a Go Context. Panics if it can't. func GoContext(ctxHandle uint64) *context.T { valptr := sutil.GoGetRef(ctxHandle) if ctx, ok := valptr.(*context.T); ok { return ctx } else { panic(fmt.Sprintf("Couldn't get context from handle with id %d", ctxHandle)) } }