// Close implements io.Closer.
557316
func (br *BlockReader) Close() error {
	br.closed = true
	if br.conn != nil {
		br.conn.Close()
	}

	return nil
}
522085
func (w *Writer) Close() error {
	if w.BeforeClose != nil {
		w.BeforeClose()
	}

	if closer, ok := w.Writer.(io.Closer); ok {
		err := closer.Close()
		if err != nil {
			return err
		}
	}

	if w.AfterClose != nil {
		w.AfterClose()
	}

	return nil
}
586987
func (d deleteOnClose) Close(ctx context.Context, corrupt bool) (err error) {
	name := d.File.Name()
	defer func() {
		if rmErr := os.Remove(name); err == nil && rmErr != nil && !os.IsNotExist(rmErr) {
			err = rmErr
		}
	}()
	return d.File.Close()
}
1144197
func (e *ExecIO) Close() error {
	if e.closer != nil {
		e.closer.Close()
	}
	if e.fifos != nil {
		return e.fifos.Close()
	}
	return nil
}
1240794
func (s *safeCloser) Close() (err error) {
	if s.r != nil {
		err = s.r.Close()
	} else if s.w != nil {
		err = s.w.Close()
	}

	select {
	case s.ch <- struct{}{}:
		return err
	default:
		return s.c.Close()
	}
}
1352097
func (f *removeOnClose) Close() error {
	if f == nil || f.File == nil {
		return nil
	}
	name := f.File.Name()
	if err := f.File.Close(); err != nil {
		return err
	}
	if err := os.Remove(name); err != nil && !os.IsNotExist(err) {
		return err
	}
	return nil
}
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
}
1350040
func (f deleteOnCloseFile) Close() error {
	f.File.Close()
	os.Remove(f.Name())
	return nil
}
83577
func (c *IO) Close(handle string) (*gcdmessage.ChromeResponse, error) {
	var v IOCloseParams
	v.Handle = handle
	return c.CloseWithParams(&v)
}
334695
func (r *Receiver) Close() error {
	r.cl.Lock()
	defer r.cl.Unlock()
	if r.cl.client == nil {
		return ErrNotConnected
	}
	close(r.chanClose)
	return r.cl.Close()
}
166664
func (l *Logger) Close() error {
	// Will close local/remote syslog connections too :)
	if closer, ok := l.writer.(io.WriteCloser); ok {
		l.fileMu.Lock()
		err := closer.Close()
		l.fileMu.Unlock()
		return err
	}

	return nil
}
1040691
func (p *Packfile) Close() error {
	closer, ok := p.file.(io.Closer)
	if !ok {
		return nil
	}

	return closer.Close()
}
1072282
func (f *Logfile) Close() error {
	f.Lock()
	defer f.Unlock()

	return f.closeLog()
}
872916
func (t *File) Close() error {
	if t.fh == nil {
		return nil
	}
	return t.fh.Close()
}
250773
func (loop Loop) Close() error {
	errc := make(chan error)
	loop.closing <- errc
	return <-errc
}
702564
func (c *Closer) Close() (err error) {
	c.o.Do(func() {
		// Get close funcs
		c.m.Lock()
		fs := append([]CloseFunc{}, c.fs...)
		c.m.Unlock()

		// Loop through closers
		var errs []error
		for _, f := range fs {
			if errC := f(); errC != nil {
				errs = append(errs, errC)
			}
		}

		// Process errors
		if len(errs) == 1 {
			err = errs[0]
		} else if len(errs) > 1 {
			err = astierror.NewMultiple(errs)
		}
	})
	return
}
865284
func (w *Writer) Close() error {
	defer w.Done()
	if c, ok := w.Writer.(io.Closer); ok {
		return c.Close()
	}
	return nil
}