GoLang: async http request handling : I'm try to handle an HTTP request in GoLang, asynchronously this way:

 1. I pass a handler function to the HTTP server
 2. In the handler I store the HttpRequest / HttpResponse objects in a slice or a map
 3. When returning from the handler function - the response is NOT returned to the client, but the connection remains open
 4. When "some" async input received from another source, I take the relevant HttpRequest / HttpResponse objects from memory, write the response and close the connection.

What I aim for is very similar to Jetty-Continuation in Java.

How can I implement such a behaviour in GoLang?

Thanks