dtrgqjcd877528 2018-01-25 01:51
浏览 65

使用Golang RPC时发生错误:错误的数据:未定义的类型arrayType

I am trying to use the golang RPC calls to pass the structures and I get a error while sending the structures.

Currently, whenever I am passing the CNI struct results with Ipv6 parameters then I get the following error:

gob: bad data: undefined type arrayType = strcut { CommonType CommonType = struct { Name string; Id int; }; Elem int; Len int; }

But, whenever I pass the Ipv4 structure I never get that error.

What can be the reason?

Please, let me know if you guys need more info.

My struct looks like this:

The CNI import of the Result struct:

"GitHub.com/containernetworking/cni/pkg/types/current"

type NetworkArgs struct {
Sandbox string
IfName string
Result *current.Result
}

My result looks like:

{ [{Name:eth0 Mac:92:26:b0:72:da:85 Sandbox:/proc/20314/ns/net}] [{Version:6 Interface:0xc42061be70 Address:{IP:2002:2:1:1::53 Mask:ffffffffffffffff0000000000000000} Gateway:2002:2:1:1::1}] [{Dst:{IP::: Mask:00000000000000000000000000000000} GW:2002:2:1:1::1}] {[] [] []}}

And I call the

client.Call(my_method, &NetworkArgs{sandbox, ifName, result}}, reply)
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#网络安全#的问题:求ensp的网络安全,不要步骤要完成版文件
    • ¥15 可否在不同线程中调用封装数据库操作的类
    • ¥20 使用Photon PUN2解决游戏得分同步的问题
    • ¥15 微带串馈天线阵列每个阵元宽度计算
    • ¥15 keil的map文件中Image component sizes各项意思
    • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 Vue3 大型图片数据拖动排序