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 }
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 }