我正在使用来自 Gorilla Web Toolkit 的 Mux 库以及捆绑的 Go http 服务器。
The problem is that in my application the HTTP server is only one component and it is required to stop and start at my discretion.
当我调用 http.ListenAndServe(fmt.Sprintf(":%d", service.Port()), service.router)
它阻塞,我似乎不能停止服务器运行。
I am aware this has been a problem in the past, is that still the case? Are there any new solutions?