我在 go 中有一个结构是:
type AcceptMsg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Rnd *Round `protobuf:"bytes,1,opt,name=rnd,proto3" json:"rnd,omitempty"`
Slot *Slot `protobuf:"bytes,2,opt,name=slot,proto3" json:"slot,omitempty"`
Val *Value `protobuf:"bytes,3,opt,name=val,proto3" json:"val,omitempty"`
}
我已经将该结构中的实例添加到acceptMsgQueue *list.List 我的问题中,当我从列表中接收到它们时,如何访问实例的变量:
for f := p.acceptMsgQueue.Front(); f != nil; f = f.Next() {
acceptMsg := f.Value
}
当我在 vscode 中将点从 of放入时,它无法将其识别为正确的类型,并且acceptMsg我无权访问Rnd和作为.SlotValacceptMsg
慕姐8265434
相关分类