sentinel.go
func New(opts ...Option) (*Sentinel, error) {
	s := &Sentinel{
		shutdownDuration: DefaultShutdownDuration,
		logf:             func(string, ...interface{}) {},
	}

	var err error

	// apply options
	for _, o := range opts {
		if err = o(s); err != nil {
			return nil, err
		}
	}

	// ensure sigs set
	if s.shutdownSigs == nil {
		s.shutdownSigs = []os.Signal{os.Interrupt}
	}

	// ensure errf set
	if s.errf == nil {
		s.errf = func(str string, v ...interface{}) {
			s.logf("ERROR: "+str, v...)
		}
	}

	return s, nil
}
func New(opts ...Option) (*Sentinel, error) {
	s := &Sentinel{
		shutdownDuration: DefaultShutdownDuration,
		logf:             func(string, ...interface{}) {},
	}

	var err error

	// apply options
	for _, o := range opts {
		if err = o(s); err != nil {
			return nil, err
		}
	}

	// ensure sigs set
	if s.shutdownSigs == nil {
		s.shutdownSigs = []os.Signal{os.Interrupt}
	}

	// ensure errf set
	if s.errf == nil {
		s.errf = func(str string, v ...interface{}) {
			s.logf("ERROR: "+str, v...)
		}
	}

	return s, nil
}
// New creates a new sentinel server group.