Go语言中文网 为您找到相关结果 1

Golang1.7闲来无事写了一个基于Gob的tcp通讯用的包

package gobconn import ( "encoding/gob" "errors" "net" "reflect" "sync" "unsafe" ) type message struct { Type string value reflect.Value } func (self message) Recovery() { putPointer(self.value) putMsg(self) } func (self message) Interface() interface{} { return self.value.Elem().Interface() } /* 声明一个消息池用来重用对象 */ var msgPool sync.Pool func getMsg()...阅读全文

博文 2016-10-13 17:00:05 fyxichen