On Wed, Dec 4, 2019 at 5:21 PM FAN DEAR wrote:
>
> First of all, thank you very much for your reply.
> Actually, what I want to do is to use golang to complete the TCP
> communication SDK.
> When C++ calls golang to send a message,
> I need to tell the C++ message sending status at the appropriat
First of all, thank you very much for your reply.
Actually, what I want to do is to use golang to complete the TCP
communication SDK.
When C++ calls golang to send a message,
I need to tell the C++ message sending status at the appropriate time, such
as sending failed, sending successfully, and
On Tue, Dec 3, 2019 at 12:29 AM FAN DEAR wrote:
>
> typedef struct { void *t; void *v; } GoInterface;
>
>
> What is *t and *v?
See https://research.swtch.com/interfaces.
Ian
> 在 2019年12月3日星期二 UTC+8上午2:41:36,Ian Lance Taylor写道:
>>
>> On Mon, Dec 2, 2019 at 9:57 AM FAN DEAR wrote:
>> >
>> >
>>
typedef struct { void *t; void *v; } GoInterface;
What is *t and *v?
在 2019年12月3日星期二 UTC+8上午2:41:36,Ian Lance Taylor写道:
>
> On Mon, Dec 2, 2019 at 9:57 AM FAN DEAR >
> wrote:
> >
> >
> > How to use add2 function, i am very troubled.
>
> On this mailing list please post code as ordinary tex
On Mon, Dec 2, 2019 at 9:57 AM FAN DEAR wrote:
>
>
> How to use add2 function, i am very troubled.
On this mailing list please post code as ordinary text, or as a link
to the Go playground. Don't post colorized images with a black
background. Thanks.
You can't declare a Go interface type in C.
in my go file:
package main
import "C"
// AddListener ...
//export AddListener
type AddListener interface {
addResult(i int)
}
func main() {
}
// Add ...
//export Add
func Add(i, j int) int {
return i + j
}
// Add2 ...
//export Add2
func Add2(i, j int, listener AddListener) {
listener.addResu