// Close wraps the io.ReaderCloser Close function to clean up everything. ProgressReader
// objects should always be closed to make sure everything is cleaned up.
763356
func (p *ProgressReader) Close() (err error) {
	err = p.r.Close()
	p.stopProgress()
	return
}
666818
func (f *fileCloser) Close() error {
	err := f.f.Close()
	if err != nil {
		return fmt.Errorf(
			"Could not close file %v: %v",
			f.path,
			err,
		)
	}
	return nil
}
172247
func (l *JSONFileLogger) Close() error {
	l.mu.Lock()
	l.closed = true
	err := l.writer.Close()
	for r := range l.readers {
		r.ProducerGone()
		delete(l.readers, r)
	}
	l.mu.Unlock()
	return err
}
1074917
func (f *FileReader) Close() error {
	f.closed = true

	if f.blockReader != nil {
		f.blockReader.Close()
	}

	return nil
}
1202097
func (w *wrapReadCloser) Close() error {
	w.reader.Close()
	w.writer.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
}
455789
func (c *Client) Close() (err error) {
	if c.text != nil {
		c.printfLine("close")
		err = c.text.Close()
		c.text = nil
	}
	return
}
780392
func (t *TSMReader) Close() error {
	t.refsWG.Wait()

	t.mu.Lock()
	defer t.mu.Unlock()

	if err := t.accessor.close(); err != nil {
		return err
	}

	return t.index.Close()
}
1035932
func (o *offsetReader) Close() error {
	o.lock.Lock()
	defer o.lock.Unlock()
	o.closed = true
	return nil
}
1177757
func (mr *Reader) Close() error {
	if mr.err == errClosed {
		return nil
	}
	if mr.err != nil && mr.err != io.EOF {
		return mr.err
	}

	mr.FinalMode = mr.final
	mr.err = errClosed
	mr.rd = nil // Release reference to underlying Reader
	return nil
}
723922
func (l *Slog) Close() error {
	if l.Writter == nil {
		return nil
	}
	return e.New(l.Writter.Close())
}
1337491
func (r *BackupFileReader) Close() error {
	if r.ctx != 0 {
		backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx)
		runtime.KeepAlive(r.f)
		r.ctx = 0
	}
	return nil
}
31215
func (lli *llIterator) Close() error {
	var err0 error
	if lli.kvIterator != nil {
		err0 = lli.kvIterator.Close()
		lli.kvIterator = nil
	}

	var err1 error
	if lli.kvReader != nil {
		err1 = lli.kvReader.Close()
		lli.kvReader = nil
	}

	lli.llSnapshot.decRef()
	lli.llSnapshot = nil

	if err0 != nil {
		return err0
	}

	if err1 != nil {
		return err1
	}

	return nil
}
150980
func (t *Tar) Close() error {
	var err error
	if t.tr != nil {
		t.tr = nil
	}
	if t.tw != nil {
		tw := t.tw
		t.tw = nil
		err = tw.Close()
	}
	// make sure cleanup of "Reader/Writer wrapper"
	// (say that ten times fast) happens AFTER the
	// underlying stream is closed
	if t.cleanupWrapFn != nil {
		t.cleanupWrapFn()
	}
	return err
}
254116
func (f *File) Close() error {
	if f.closed {
		return &os.PathError{"close", f.Name, syscall.EINVAL}
	}
	f.closed = true

	if f.writing {
		if err := f.pipeW.Close(); err != nil {
			return err
		}
	}

	if f.reader != nil {
		if err := f.reader.Close(); err != nil {
			return err
		}
	}

	return nil
}
901468
func (l *Listener) Close() error {
	return l.opError(opClose, l.l.Close())
}
135960
func (m *Mux) Close() error {
	m.m.Lock()
	runtime.SetFinalizer(m, nil)
	m.readers = nil
	m.closed = true
	m.m.Unlock()
	return nil
}