To gracefully shutdown a http server requires a few steps.
The http library's serving function will block over there when getting started, until we call http.Server.Close(). As for us, we can invoke the starting function in a goroutine, and call close in another one.
Signal plays an important role in communication with POSIX system.
For example, what if our code been killed, interrupted, hung on? Generally, the operation system (I am talking about BSD, Unix-like, POSIX system, same in the follow but will omitted), will not really "KILL" it, it will just send a kill signal with id to this process, the this process will process this signal later.
Here is a table to describe the id to default action.