// Close closes the GroupReader by closing the cursor file.
7263
func (gr *GroupReader) Close() error {
	gr.mtx.Lock()
	defer gr.mtx.Unlock()

	if gr.curReader != nil {
		err := gr.curFile.Close()
		gr.curIndex = 0
		gr.curReader = nil
		gr.curFile = nil
		gr.curLine = nil
		return err
	}
	return nil
}
421364
func (g *Group) Close() {
	for _, ch := range g.bus {
		close(ch)
	}
	g.bus = nil
}
1074917
func (f *FileReader) Close() error {
	f.closed = true

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

	return nil
}
1347340
func (t *TeeReadCloser) Close() error {
	err1 := t.c.Close()
	err2 := t.w.Close()
	if err1 != nil {
		return err1
	}
	return err2
}
1237728
func close(f io.Closer) {
	err := f.Close()
	if err != nil {
		log.Warnf("Failed to close the file/writer/reader. %v", err)
	}
}
1308574
func (g *WriterGroup) Close() {
	g.mu.Lock()
	defer g.mu.Unlock()
	for _, w := range g.writers {
		w.Close()
	}
	g.writers = nil
	g.closed = true
}
14345
func (bg *Reader) Close() error {
	if bg.control != nil {
		close(bg.control)
		close(bg.waiting)
		<-bg.done
	}
	if bg.err == io.EOF {
		return nil
	}
	return bg.err
}
232320
func (r ReaderSeekerCloser) Close() error {
	switch t := r.r.(type) {
	case io.Closer:
		return t.Close()
	}
	return nil
}
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
}
1355883
func (b BufferedFileWriter) Close() error {
	if err := b.Flush(); err != nil {
		return err
	}
	return b.file.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
}
1281851
func (r *CompressingStoredFieldsReader) Close() (err error) {
	if !r.closed {
		if err = util.Close(r.fieldsStream); err == nil {
			r.closed = true
		}
	}
	return
}
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
}
764280
func (m *hashReader) Close() error {
	if m.source == nil {
		return nil
	}
	if r, ok := m.source.(io.Closer); ok {
		return r.Close()
	}
	return nil
}
298137
func (z *reader) Close() error {
	if z.err != nil && z.err != io.EOF {
		return z.err
	}
	z.err = z.decompressor.Close()
	return z.err
}
248746
func (s *TranslateFile) Close() (err error) {
	s.once.Do(func() {
		close(s.closing)

		if s.file != nil {
			if e := s.file.Close(); e != nil && err == nil {
				err = e
			}
		}
		if s.data != nil {
			if e := syscall.Munmap(s.data); e != nil && err == nil {
				err = e
			}
		}
	})
	s.wg.Wait()
	return err
}
1275706
func (r *Reader) Close() error {
	if r.input != nil {
		r.input.Close()
	}
	if r.output != nil {
		r.output.Close()
	}
	if r.cmd != nil {
		return r.cmd.Wait()
	}
	return nil
}