golang struct 定义中的 chan 词是什么意思

用户3400063

我正在阅读以太坊代码,以下是什么意思

<-chan struct{}chan<- error

type protoRW struct {
   Protocol
   in     chan Msg        // receives read messages
   closed <-chan struct{} // receives when peer is shutting down
   wstart <-chan struct{} // receives when write may start
   werr   chan<- error    // for write results
   offset uint64
   w      MsgWriter
}
姆科普里瓦

里面的struct { ... }列表是字段声明的列表Protocol顶部字段是嵌入的字段声明其余的使用<FieldName> <FieldType>格式声明例如closed <-chan struct{},一个名为closed字段,其类型为<-chan struct{}元素类型为空结构的仅接收 通道)。Andwerr chan<- error是一个名为werrtype的字段chan<- error元素类型为的仅发送通道error)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

星号(* struct)表示法在golang中是什么意思

chan.go中的“ hchanSize”是什么意思

nil在golang中是什么意思?

在golang中,“某物”是什么意思

Golang中的var()是什么意思

struct_name(0) 在solidity中是什么意思

Golang中的0x1是什么意思?

*(* int)(nil)= 0在golang中是什么意思?

瓦特语在golang中是什么意思?

IntelliJ的golang插件中的“系统环境”是什么意思?

Golang文档中“ interface {}”之前的“ a”和“ ...”是什么意思?

golang中[] [] *数据类型是什么意思

“ MOVOU”在golang汇编中是什么意思

Golang中以下代码行是什么意思?

javascript中颜色这个词是什么意思

wx在wxWidgets一词中是什么意思?

在Hugo文档中,“⊢-^-and”和类似词是什么意思?

在MySQL中,“ Stopword”一词是什么意思?

struct中变量名前面的点是什么意思?

struct node *next 是什么意思;在用c语言制作的链表程序中?

golang中的(切片)变量初始值设定项中的[...]是什么意思?

struct之后的public是什么意思?

((Struct *)0)是什么意思?

struct Cleaner <T *>是什么意思?

指针接收器和值接收器在Golang中是什么意思?

关于golang规范中方法值的部分中的“非接口方法”是什么意思?

golang的zlib / reader.go文件中的“ r。(flate.Reader)”是什么意思?

Golang中Make字符串末尾的json:“ make”是什么意思?

//go:build xxx 和 // +build xxx 在 golang 中是什么意思?