client.go
func (c *Client) Exec(r Request) (*Response, error) {
	var err error

	// Initialize connection if none available
	if c.conn == nil {
		c.conn, err = c.dialer.Dial(c.network, c.address)
		if err != nil {
			return nil, err
		}

		if r.keepAlive() {
			switch c.network {
			case "tcp":
				c.conn.(*net.TCPConn).SetKeepAlive(true)
			}
		} else {
			defer c.Close()
		}
	}

	return r.handle(c.conn)
}
func (c *Client) Exec(r Request) (*Response, error) {
	var err error

	// Initialize connection if none available
	if c.conn == nil {
		c.conn, err = c.dialer.Dial(c.network, c.address)
		if err != nil {
			return nil, err
		}

		if r.keepAlive() {
			switch c.network {
			case "tcp":
				c.conn.(*net.TCPConn).SetKeepAlive(true)
			}
		} else {
			defer c.Close()
		}
	}

	return r.handle(c.conn)
}
func ( c * Client ) Exec ( r Request ) ( * Response , error ) { var err error // Initialize connection if none available if c . conn == nil { c . conn , err = c . dialer . Dial ( c . network , c . address ) if err != nil { return nil , err } if r . keepAlive ( ) { switch c . network { case " " : c . conn . ( * net . TCPConn ) . SetKeepAlive ( true ) } } else { defer c . Close ( ) } } return r . handle ( c . conn ) }
// Exec executes a given Livestatus query.
Exec executes a given Livestatus query .