SONIC: SWIG generated golang code state

12 views
Skip to first unread message

Shekhar Rana

unread,
May 13, 2024, 9:05:28 AMMay 13
to sonicproject
Hi Community,
    with swig generated golang wrappers, is there good reference for unit test codes around ConsumerStateTable or other c++ classes?
We noticed few issues e.g. c++ tuple is not supported for golang, so it gets hard to invoke CST.Pops().
Also for Select(), at c++ level it expects a **selectable but not able to figure out on how to pass that from go via Xselect()? i can get the code compling but at run time it goes into NPE loops..
e.g.
"
    var dPtr *swsscommon.Selectable
    for ret := cs.Xselect(&dPtr); ret == 0; ret = cs.Xselect(&dPtr) {
"
Runtime error
"
+panic: interface conversion: **swsscommon.Selectable is not swsscommon.Selectable: missing method GetFd
"

So any references to sample golang based codes would help.

Regards
Shekhar
Reply all
Reply to author
Forward
0 new messages