mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-03 00:38:40 +08:00
17 lines
221 B
Go
17 lines
221 B
Go
package internal
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"zero/core/proc"
|
|
)
|
|
|
|
func StartServer(srv *http.Server) error {
|
|
proc.AddWrapUpListener(func() {
|
|
srv.Shutdown(context.Background())
|
|
})
|
|
|
|
return srv.ListenAndServe()
|
|
}
|