Allow to close the connection

This commit is contained in:
2018-11-11 20:32:59 +01:00
parent 9e62446755
commit ca74b866b6
2 changed files with 13 additions and 1 deletions
+5
View File
@@ -155,6 +155,11 @@ func (c *Conn) SetVar(name, val string) error {
return c.conn.Exec(fmt.Sprintf("SET %s=%q", name, val))
}
// Close the connection.
func (c *Conn) Close() error {
return c.conn.Close()
}
func (c *Conn) runCmd(data []byte) error {
err := c.conn.WritePacket(data)
if err != nil {