sentinel.go
func (s *Sentinel) Shutdown() error {
	var firstErr error
	for i, f := range s.shutdownFuncs {
		ctxt, cancel := context.WithTimeout(context.Background(), s.shutdownDuration)
		defer cancel()
		if err := f(ctxt); err != nil {
			s.errf("could not shutdown %d: %v", i, err)
			if firstErr == nil {
				firstErr = err
			}
		}
	}
	return firstErr
}
func (s *Sentinel) Shutdown() error {
	var firstErr error
	for i, f := range s.shutdownFuncs {
		ctxt, cancel := context.WithTimeout(context.Background(), s.shutdownDuration)
		defer cancel()
		if err := f(ctxt); err != nil {
			s.errf("could not shutdown %d: %v", i, err)
			if firstErr == nil {
				firstErr = err
			}
		}
	}
	return firstErr
}
// Shutdown calls all registered shutdown funcs.