func (s *Server) Shutdown(ctx context.Context) error {
	ctx, cancelFunc := context.WithTimeout(ctx, s.StopDur)
	defer cancelFunc()
	httpsShutdownErr := s.HTTPSServer.Shutdown(ctx)
	httpShutdownErr := s.HTTPServer.Shutdown(ctx)
	switch {
	case httpsShutdownErr != nil:
		return httpsShutdownErr
	case httpShutdownErr != nil:
		return httpShutdownErr
	}
	s.wg.Wait()
	return nil
}
// Shutdown asks the servers to shutdown and waits for the shutdown to complete.
// An error is returned if the server context times out.
Shutdown asks the servers to shutdown and waits for the shutdown to complete.
An error is returned if the server context times out.
// Shutdown asks the servers to shutdown and waits for the shutdown to complete . // An error is returned if the server context times out .
func (s *Server) Shutdown(ctx context.Context) error {
	ctx, cancelFunc := context.WithTimeout(ctx, s.StopDur)
	defer cancelFunc()
	httpsShutdownErr := s.HTTPSServer.Shutdown(ctx)
	httpShutdownErr := s.HTTPServer.Shutdown(ctx)
	switch {
	case httpsShutdownErr != nil:
		return httpsShutdownErr
	case httpShutdownErr != nil:
		return httpShutdownErr
	}
	s.wg.Wait()
	return nil
}
func ( s * Server ) Shutdown ( ctx context . Context ) error { ctx , cancelFunc := context . WithTimeout ( ctx , s . StopDur ) defer cancelFunc ( ) httpsShutdownErr := s . HTTPSServer . Shutdown ( ctx ) httpShutdownErr := s . HTTPServer . Shutdown ( ctx ) switch { case httpsShutdownErr != nil : return httpsShutdownErr case httpShutdownErr != nil : return httpShutdownErr } s . wg . Wait ( ) return nil }
Shutdown asks the servers to shutdown and waits for the shutdown to complete.
Shutdown asks the servers to shutdown and waits for the shutdown to complete .