// Close TODO(rjeczalik)
545321
func (t *recursiveTree) Close() error {
	err := t.w.Close()
	close(t.c)
	return err
}
653667
func (ch *Ch) Close() {
	close(ch.Err)
	close(ch.Size)
	close(ch.Done)
}
874434
func (client *Client) Close() {
	client.mu.Lock()
	defer client.mu.Unlock()
	for _, c := range client.rpcClientMap {
		close(c)
		for ch := range c {
			ch.cc.Close()
		}
	}
	client.rpcClientMap = nil
}
388966
func (c *closeHelper) Close(cl io.Closer) {
	if err := cl.Close(); c.err == nil {
		c.err = err
	}
}
333882
func (m *TryMutex) Close() error {
	//log.Debug("TryMutex: close")
	if err := m.sess.Close(); err != nil {
		log.Errorf("TryMutex: close err: %v", err)
		return err
	}
	return nil
}
1246208
func (s *server) Close() (err error) {
	s.closeOnce.Do(
		func() {
			err = s.close()
			s.closeSignal <- 1
			<-s.closedSignal
		})
	return
}
509917
func (r *Response) Close() error {

	if r.Error != nil {
		return r.Error
	}

	io.Copy(ioutil.Discard, r)

	return r.RawResponse.Body.Close()
}
600466
func (dw Writer) Close() error {
	dw.c()
	<-dw.done
	if w, ok := dw.w.(io.Closer); ok {
		return w.Close()
	}
	return nil
}
1001329
func (c *mongoDBConnectionProducer) Close() error {
	c.Lock()
	defer c.Unlock()

	if c.session != nil {
		c.session.Close()
	}

	c.session = nil

	return nil
}
956220
func (cluster *Cluster) Close() {
    cluster.rwLock.Lock()
    defer cluster.rwLock.Unlock()

    for addr, node := range cluster.nodes {
	node.shutdown()
	delete(cluster.nodes, addr)
    }

    cluster.closed = true
}
455789
func (c *Client) Close() (err error) {
	if c.text != nil {
		c.printfLine("close")
		err = c.text.Close()
		c.text = nil
	}
	return
}
3664
func (m *MockUpgradeMachineSeriesAPI) Close() error {
	ret := m.ctrl.Call(m, "Close")
	ret0, _ := ret[0].(error)
	return ret0
}
702500
func (r *realisClient) Close() {

	r.lock.Lock()
	defer r.lock.Unlock()

	r.transport.Close()
}
1087827
func (s *Server) Close(ctx context.Context) error {
	return s.Shutdown(ctx)
}
102393
func (c *RPCClient) Close() error {
	c.shutdownLock.Lock()
	defer c.shutdownLock.Unlock()

	if !c.shutdown {
		c.shutdown = true
		close(c.shutdownCh)
		c.deregisterAll()
		return c.conn.Close()
	}
	return nil
}
438791
func Close(objs ...interface{}) error {
	errs := make([]error, len(objs))

	for i, obj := range objs {
		errs[i] = safeClose(obj)
	}

	for _, err := range errs {
		if err != nil {
			return CloseErrors(errs)
		}
	}

	return nil
}
1322868
func (o *Object) Close() (err error) {
	if o == nil {
		return ErrInvalidArgument("Object is nil")
	}
	// Locking.
	o.mutex.Lock()
	defer o.mutex.Unlock()

	// if already closed return an error.
	if o.isClosed {
		return o.prevErr
	}

	// Close successfully.
	close(o.doneCh)

	// Save for future operations.
	errMsg := "Object is already closed. Bad file descriptor."
	o.prevErr = errors.New(errMsg)
	// Save here that we closed done channel successfully.
	o.isClosed = true
	return nil
}