func newOutMsgV1(hdr *rpc.Header, body interface{}) outMsgV1 {
	result := outMsgV1{
		RequestId: hdr.RequestId,
		Type:      hdr.Request.Type,
		Version:   hdr.Request.Version,
		Id:        hdr.Request.Id,
		Request:   hdr.Request.Action,
		Error:     hdr.Error,
		ErrorCode: hdr.ErrorCode,
		ErrorInfo: hdr.ErrorInfo,
	}
	if hdr.IsRequest() {
		result.Params = body
	} else {
		result.Response = body
	}
	return result
}
// newOutMsgV1 fills out a outMsgV1 with information from the given header and
// body. This might look a lot like the v0 method, and that is because it is.
// However, since Go determines structs to be sufficiently different if the
// tags are different, we can't use the same code. Theoretically we could use
// reflect, but no.
newOutMsgV1 fills out a outMsgV1 with information from the given header and
body. This might look a lot like the v0 method, and that is because it is.
However, since Go determines structs to be sufficiently different if the
tags are different, we can't use the same code. Theoretically we could use
reflect, but no.
// newOutMsgV1 fills out a outMsgV1 with information from the given header and // body . This might look a lot like the v0 method and that is because it is . // However since Go determines structs to be sufficiently different if the // tags are different we can ' t use the same code . Theoretically we could use // reflect but no .
func newOutMsgV1(hdr *rpc.Header, body interface{}) outMsgV1 {
	result := outMsgV1{
		RequestId: hdr.RequestId,
		Type:      hdr.Request.Type,
		Version:   hdr.Request.Version,
		Id:        hdr.Request.Id,
		Request:   hdr.Request.Action,
		Error:     hdr.Error,
		ErrorCode: hdr.ErrorCode,
		ErrorInfo: hdr.ErrorInfo,
	}
	if hdr.IsRequest() {
		result.Params = body
	} else {
		result.Response = body
	}
	return result
}
func newOutMsgV1 ( hdr * rpc . Header , body interface { } ) outMsgV1 { result := outMsgV1 { RequestId : hdr . RequestId , Type : hdr . Request . Type , Version : hdr . Request . Version , Id : hdr . Request . Id , Request : hdr . Request . Action , Error : hdr . Error , ErrorCode : hdr . ErrorCode , ErrorInfo : hdr . ErrorInfo , } if hdr . IsRequest ( ) { result . Params = body } else { result . Response = body } return result }
newOutMsgV1 fills out a outMsgV1 with information from the given header and
body.
newOutMsgV1 fills out a outMsgV1 with information from the given header and body .