示例#1
0
文件: table.go 项目: tradia/gotable
func replyHandle(out proto.PkgResponse) []byte {
	var pkg = make([]byte, out.Length())
	_, err := out.Encode(pkg)
	if err != nil {
		log.Fatalf("Encode failed: %s\n", err)
	}
	return pkg
}
示例#2
0
文件: table.go 项目: tradia/gotable
func errorHandle(out proto.PkgResponse, errCode int8) []byte {
	out.SetErrCode(errCode)
	var pkg = make([]byte, out.Length())
	_, err := out.Encode(pkg)
	if err != nil {
		log.Fatalf("Encode failed: %s\n", err)
	}
	return pkg
}