I\'m learning Go by writing an app for GAE, and this is signature of a handler function:
func handle(w http.ResponseWriter, r *http.Request) {}
I think that the main reason for the Request
object to be passed as a pointer is the Body
field. For a given HTTP request, the body can only we read once. If the Request
object was cloned, as it would be if it wasn't passed as a pointer, we would have two objects with different information about how much has been read from the body.