管道 包 npipe 提供了一个围绕 Windows 命名管道的纯 Go 包装器。 Windows 命名管道文档: : 请注意,代码位于分支),但应导入为 gopkg.in/natefinch/npipe.v2(包名称仍为 npipe)。 npipe 提供了一个基于 stdlib 的 net 包的接口,带有 Dial、Listen 和 Accept 函数,以及相关的 net.Conn 和 net.Listener 实现。 它支持通过连接进行 rpc。 笔记 由于 Windows API 的限制,读取/写入连接的截止日期仅在 Windows Vista/Server 2008 及更高版本中有效。 管道仅支持字节模式(不支持消息模式) 例子 Dial 函数将客户端连接到命名管道: conn, err := npipe.Dial(`\\.\pipe\mypipename`) i