I'm writing a chat program with Golang and Gorilla's Websocket toolkit.
I'm wondering if there is a way to run a function whenever a user disconnects or a ping/pong message fails. I need this to remove them from variables and such. Is there any easy way to do this?