Files
go-zero/core/httpserver/starter.go
2020-07-26 17:09:05 +08:00

17 lines
223 B
Go

package httpserver
import (
"context"
"net/http"
"zero/core/proc"
)
func StartServer(srv *http.Server) error {
proc.AddWrapUpListener(func() {
srv.Shutdown(context.Background())
})
return srv.ListenAndServe()
}