// Close() terminates the prxy; it can not be restarted.
970885
func (p *proxy) Close() error {
	p.listener.Close()
	errc := make(chan error)
	p.closing <- errc
	return <-errc
}
278343
func (p *Reader) Close() error {
	if p.current < p.size {
		// print a full progress bar when closing prematurely
		p.current = p.size
		p.updateProgress(false)
	}
	return p.in.Close()
}
546770
func Close(c Closer) {
	if err := c.Close(); err != nil {
		log.Warnf("failed to close %v: %v", c, err)
	}
}
745566
func (p *Pipe) Close() error {
	if p.stdout != nil {
		p.stdout.Close()
	}
	if p.jq == nil {
		return nil
	}
	if p.jq.ProcessState != nil && p.jq.ProcessState.Exited() {
		return nil
	}
	if p.jq.Process != nil {
		p.jq.Process.Kill()
		go p.jq.Process.Wait()
	}
	return nil
}
1072282
func (f *Logfile) Close() error {
	f.Lock()
	defer f.Unlock()

	return f.closeLog()
}
1302824
func (e *env) Close() error {
	e.l.Lock()
	defer e.l.Unlock()
	e.shouldClose = true
	e.e.Sync(1)
	e.e.Close()
	return nil
}
334788
func (c *connection) Close() error {
	c.mu.Lock()
	if c.stopErr == nil {
		c.stopErr = ErrClosed
		close(c.stop)
	}
	c.mu.Unlock()
	return c.rw.Close()
}
1268285
func (c *Conn) Close() error {
	return c.opError(opClose, c.fd.Close())
}
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
}
552541
func (c *Client) Close() error {
	c.once.Do(func() { close(c.done) })
	c.Flush()
	return nil
}
595722
func (s *state) Close() error {
	if s.cancel != nil {
		s.cancel()
	}
	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
}
799621
func (s *BufferedSender) Close() error {
	// since we are running, write lock during cleanup
	s.runmx.Lock()
	defer s.runmx.Unlock()
	if !s.running {
		return nil
	}

	errChan := make(chan error)
	s.running = false
	s.shutdown <- errChan
	return <-errChan
}
39161
func (rwops *RWops) Close() error {
	if rwops != nil && C.RWclose(rwops.cptr()) != 0 {
		return GetError()
	}
	return nil
}
777421
func (s *Server) Close() error {
	s.listenerMutex.Lock()
	defer s.listenerMutex.Unlock()
	s.closed = true
	if s.listener != nil {
		err := s.listener.Close()
		s.listener = nil
		return err
	}
	return nil
}
1031106
func (w *minifyWriter) Close() error {
	w.pw.Close()
	w.wg.Wait()
	return w.err
}
523765
func Close(xs XStater) error {
	if c, ok := xs.(io.Closer); ok {
		return c.Close()
	}
	return nil
}