nsqlookupdhttps://nsq.io/components/nsqlookupd.htmlnsqlookupd 是管理拓扑信息的守护程序。客户端通过查询 nsqlookupd 以发现指定 topic 的 nsqd 生产者,并且 nsqd 节点广播 topic 和 channel。命令参数# lookupd 节点的外部地址,默认为主机名-broadcast-address=<host># 配置文件路径-config=<pa
Protocol Buffers1.安装编译器https://github.com/protocolbuffers/protobuf/releases 或者sudo apt -y install protobuf-compiler2.安装 go 插件go get -u github.com/golang/protobuf/protoc-gen-go3.编写 protohttps://developers.google
sync.Once 是在代码运行中需要的时候执行,且只执行一次。init 函数是在文件包首次被加载的时候执行,且只执行一次。一个包中可以有多个 init 函数。init 函数不能被其它函数调用。const、var、 init 函数与 main 函数的执行顺序:验证代码package mainimport (    "fmt"    "sync"
本文最后更新于 2020/07/11 10:27:26 。
客户端调用服务端server.gopackage mainimport (    "log"    "net"    "net/http"    "net/rpc"    
本文最后更新于 2020/07/04 01:58:54 。

io.MultiWriter() 可以将多个实现 io.Writer 接口实例包装为一个,实现多实例统一写入。但在开发自定义日志库时使用此函数遇到了这样一个问提,传入的多个接口实例总会有几个不会生效,而且好似是否生效还跟入传参位置有关。

测试用的变量和方法type struct Blog {    Title string}map[string]interface{}type FuncMap map[string]interface{}func add(x, y int) int变量{{/* . 代表传入模板的 struct&nb