// src/net/http/server.go // Shutdown gracefully shuts down the server without interrupting any active connections. Shutdown works by first closing all open listeners, then closing all idle connections, and then waiting indefinitely for connections to return to idle and then shut down. If the provided context expires before the shutdown is complete, then the context's error is returned.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. - using env: export GIN_MODE=release - using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET / --> main.main.func1 (3 handlers) Handle Request success [GIN] 2017/07/12 - 20:30:47 | 200 | 3.000385597s | 127.0.0.1 | GET / ^C //终端输入Ctrl+C Shutdown Server ... listen: http: Server closed Handle Request success //在接收到关闭信号时,依然保证正在处理的请求正常处理完 [GIN] 2017/07/12 - 20:30:53 | 200 | 3.000360362s | 127.0.0.1 | GET / Server exist