Signify that Request and Response from RequestCtx and Header from Request and Response mustn't be copied by value

This commit is contained in:
Aliaksandr Valialkin
2015-11-29 12:18:33 +02:00
parent 29b732217a
commit fb07cbbd31
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -16,6 +16,8 @@ import (
// and use CopyTo() instead.
type Request struct {
// Request header
//
// Copying Header by value is forbidden. Use pointer to Header instead.
Header RequestHeader
body []byte
@@ -36,6 +38,8 @@ type Request struct {
// and use CopyTo() instead.
type Response struct {
// Response header
//
// Copying Header by value is forbidden. Use pointer to Header instead.
Header ResponseHeader
body []byte
+4
View File
@@ -219,9 +219,13 @@ func TimeoutHandler(h RequestHandler, timeout time.Duration, msg string) Request
// before return.
type RequestCtx struct {
// Incoming request.
//
// Copying Request by value is forbidden. Use pointer to Request instead.
Request Request
// Outgoing response.
//
// Copying Response by value is forbidden. Use pointer to Response instead.
Response Response
id uint64