The CloseNotifier interface is implemented by ResponseWriters which allow detecting when the underlying connection has gone away.
This appears to be an optional interface of ResponseWriter, but martini is treating it as if it's always available. In this change, the function that constructs the martini ResponseWriter wrapper checks to see if the provided http.ResponseWriter implements the CloseNotifier interface. If it does, then the returned wrapper will implement CloseNotifier as a pass-through.
According to the golang docs:
This appears to be an optional interface of ResponseWriter, but martini is treating it as if it's always available. In this change, the function that constructs the martini ResponseWriter wrapper checks to see if the provided http.ResponseWriter implements the CloseNotifier interface. If it does, then the returned wrapper will implement CloseNotifier as a pass-through.