How to gracefully shutting down a golang server?

When building a custom server application it is better to be having a shutting down mechanism for ensuring all our running processes are stopped before the server down and it will also help in bett...