I have been learning GO Lang for a month now. I have been coding in java for more than 4 years. In java the Request and Response both are object references. But, when it comes to GoLang the Response is a object reference and the Request is a Pointer Reference.
A reference, like a pointer, is an object that you can use to refer indirectly to another object. A reference declaration has essentially the same syntactic structure as a pointer declaration.
func hello(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello world!")
}
Apart from the readability perspective and the syntactic sugar is there any other intention behind using the Request as a pointer variable.
Adding to the above question the request here is an arbitrary pointer. i.e the request is not yet exists but the pointer is already referring to a memory location. Please throw some light if my understanding is wrong.