consumer/async.go
func (c *Consumer) Close() error {
	c.connsLock.Lock()
	defer c.connsLock.Unlock()

	var errStrings []string

	if len(c.conns) == 0 {
		return errors.New("connection does not exist")
	}
	for len(c.conns) > 0 {
		if err := c.conns[0].close(); err != nil {
			errStrings = append(errStrings, err.Error())
		}
		c.conns = c.conns[1:]
	}

	if len(errStrings) > 0 {
		return fmt.Errorf(strings.Join(errStrings, ", "))
	}

	return nil
}
func (c *Consumer) Close() error {
	c.connsLock.Lock()
	defer c.connsLock.Unlock()

	var errStrings []string

	if len(c.conns) == 0 {
		return errors.New("connection does not exist")
	}
	for len(c.conns) > 0 {
		if err := c.conns[0].close(); err != nil {
			errStrings = append(errStrings, err.Error())
		}
		c.conns = c.conns[1:]
	}

	if len(errStrings) > 0 {
		return fmt.Errorf(strings.Join(errStrings, ", "))
	}

	return nil
}
func ( c * Consumer ) Close ( ) error { c . connsLock . Lock ( ) defer c . connsLock . Unlock ( ) var errStrings [ ] string if len ( c . conns ) == 0 { return errors . New ( " " ) } for len ( c . conns ) > 0 { if err := c . conns [ 0 ] . close ( ) ; err != nil { errStrings = append ( errStrings , err . Error ( ) ) } c . conns = c . conns [ 1 : ] } if len ( errStrings ) > 0 { return fmt . Errorf ( strings . Join ( errStrings , " " ) ) } return nil }
// Close terminates all previously opened websocket connections to the traffic
// controller.  It will return an error if there are no open connections, or
// if it has problems closing any connection.
Close terminates all previously opened websocket connections to the traffic controller . It will return an error if there are no open connections or if it has problems closing any connection .