示例#1
0
        private static string GetOrganizationAsJson(WebWindow window, string organizationId)
        {
            var orgPtr = GoFunctions.GetOrganizationAsJson(new GoString(organizationId));
            var org    = Marshal.PtrToStringAnsi(orgPtr);

            GoFunctions.FreeString(orgPtr);
            Console.WriteLine($"[C#] GetOrganizationAsJson {organizationId} -> {org}");
            return(org);
        }
示例#2
0
        private static void GoLangDoThrow()
        {
            Console.WriteLine($"[C#] GoLangDoThrow");
            var r     = GoFunctions.DoThrow();
            var error = Marshal.PtrToStringAnsi(r);

            GoFunctions.FreeString(r);
            throw JsonConvert.DeserializeObject <RemoteException>(error);
        }