// close closes a handle handle previously returned in the response
// to SSH_FXP_OPEN or SSH_FXP_OPENDIR. The handle becomes invalid
// immediately after this request has been sent.
359078
func (c *Client) close(handle string) error {
	id := c.nextID()
	typ, data, err := c.sendPacket(sshFxpClosePacket{
		ID:     id,
		Handle: handle,
	})
	if err != nil {
		return err
	}
	switch typ {
	case ssh_FXP_STATUS:
		return normaliseError(unmarshalStatus(id, data))
	default:
		return unimplementedPacketErr(typ)
	}
}
868105
func (s *Socket) Close() error {
	if s.sock != nil {
		s.sock.Close()
	}
	return nil
}
335758
func (c *Client) Close() {
	if c.file != nil && c.file != os.Stdout {
		c.file.Close()
	}
}
698011
func (h *Handler) Close() error {
	close(h.logHandlerChan)
	h.wg.Wait()
	return h.file.Close()
}
1105631
func (l *LibHandle) Close() error {
	C.dlerror()
	C.dlclose(l.Handle)
	e := C.dlerror()
	if e != nil {
		return fmt.Errorf("error closing %v: %v", l.Libname, errors.New(C.GoString(e)))
	}

	return nil
}
889909
func (mh MultiHandle) Close() error {
	return concurrent.Range(mh, func(_ int, h Handle) error {
		return h.Close()
	})
}
111183
func (ns *NsHandle) Close() error {
	if err := syscall.Close(int(*ns)); err != nil {
		return err
	}
	(*ns) = -1
	return nil
}
1151979
func (sr *SimpleRedis) Close() error {
	return safeclose.Close(sr.client, sr.respChan, sr.closeChan)
}
1360182
func (e *Echo) Close() error {
	if err := e.TLSServer.Close(); err != nil {
		return err
	}
	return e.Server.Close()
}
1233589
func (h *handler) close(err error, inflightReq *requestOp) {
	h.cancelAllRequests(err, inflightReq)
	h.callWG.Wait()
	h.cancelRoot()
	h.cancelServerSubscriptions(err)
}
82913
func (c *Client) Close() error {
	if c.conn != nil {
		return c.conn.Close()
	}
	return nil
}
310210
func (c *Conn) Close() error {
	if !c.ok() {
		return syscall.EINVAL
	}
	if !c.isOpen() {
		return nil
	}
	select {
	case <-c.closingch:
	default:
		close(c.closingch)
	}
	select {
	case <-c.connch:
	default:
		return nil
	}
	<-c.closech
	return nil
}
205312
func (u readCloser) Close() error {
	if u.file != nil {
		return u.file.Close()
	}
	return nil
}
1091096
func (h *Handler) Close() error {
	h.done <- struct{}{}
	close(h.done)
	close(h.entries)
	return nil
}
712465
func (c *engineRPC) Close() error {
	if c.client == nil {
		return fmt.Errorf("No client to close")
	}
	if err := c.client.Close(); err != nil {
		return fmt.Errorf("Close failed: %v", err)
	}
	c.client = nil
	c.conn = nil
	return nil
}
745182
func (sb *SafeBrowser) Close() error {
	if atomic.LoadUint32(&sb.closed) == 0 {
		atomic.StoreUint32(&sb.closed, 1)
		close(sb.done)
	}
	return nil
}
99408
func (d *DL) Close() error {
	if d.handle != nil {
		d.mu.Lock()
		defer d.mu.Unlock()
		if d.handle != nil {
			mu.Lock()
			defer mu.Unlock()
			if C.dlclose(d.handle) != 0 {
				return dlerror()
			}
			d.handle = nil
		}
	}
	return nil
}