// Run starts the CA calling to the server ListenAndServe method.
Run starts the CA calling to the server ListenAndServe method.
// Run starts the CA calling to the server ListenAndServe method .
func (ca *CA) Run() error {
	var wg sync.WaitGroup
	errors := make(chan error, 1)
	if ca.insecureSrv != nil {
		wg.Add(1)
		go func() {
			defer wg.Done()
			errors <- ca.insecureSrv.ListenAndServe()
		}()
	}
	wg.Add(1)
	go func() {
		defer wg.Done()
		errors <- ca.srv.ListenAndServe()
	}()
	err := <-errors
	wg.Wait()
	return err
}
func ( ca * CA ) Run ( ) error { var wg sync . WaitGroup errors := make ( chan error , 1 ) if ca . insecureSrv != nil { wg . Add ( 1 ) go func ( ) { defer wg . Done ( ) errors <- ca . insecureSrv . ListenAndServe ( ) } ( ) } wg . Add ( 1 ) go func ( ) { defer wg . Done ( ) errors <- ca . srv . ListenAndServe ( ) } ( ) err := <- errors wg . Wait ( ) return err }
Run starts the CA calling to the server ListenAndServe method.
Run starts the CA calling to the server ListenAndServe method .
// wait till error occurs; ensures the servers keep listening