func Dial(network, addr string) (c *Client, err error) {
	text, err := textproto.Dial(network, addr)
	if err != nil {
		return nil, err
	}
	line, err := text.ReadLine()
	if err != nil {
		return nil, err
	}
	if line[0:6] != "OK MPD" {
		return nil, textproto.ProtocolError("no greeting")
	}
	return &Client{text: text, version: line[7:]}, nil
}
Dial connects to MPD listening on address addr (e.g. "127.0.0.1:6600")
on network network (e.g. "tcp").
package mpd
import (
	"errors"
	"fmt"
	"io"
	"net/textproto"
	"strconv"
	"strings"
	"time"
)
func quote(s string) string {
	q := make([]byte, 2+2*len(s))
	i := 0
	q[i], i = '"', i+1
	for _, c := range []byte(s) {
		if c == '"' || c == '\\' || c == '\'' {
			q[i] = '\\'
			i++
		}
		q[i] = c
		i++
	}
	q[i], i = '"', i+1
	return string(q[:i])
}
func quoteArgs(args []string) string {
	quoted := make([]string, len(args))
	for index, arg := range args {
		quoted[index] = quote(arg)
	}
	return strings.Join(quoted, " ")
}
type Client struct {
	text    *textproto.Conn
	version string
}
type Error struct {
	Code             ErrorCode
	CommandListIndex int
	CommandName      string
	Message          string
}
type ErrorCode int
const (
	ErrorNotList       ErrorCode = 1
	ErrorArg           ErrorCode = 2
	ErrorPassword      ErrorCode = 3
	ErrorPermission    ErrorCode = 4
	ErrorUnknown       ErrorCode = 5
	ErrorNoExist       ErrorCode = 50
	ErrorPlaylistMax   ErrorCode = 51
	ErrorSystem        ErrorCode = 52
	ErrorPlaylistLoad  ErrorCode = 53
	ErrorUpdateAlready ErrorCode = 54
	ErrorPlayerSync    ErrorCode = 55
	ErrorExist         ErrorCode = 56
)
func (e Error) Error() string {
	if e.CommandName != "" {
		return fmt.Sprintf("command '%s' failed: %s", e.CommandName, e.Message)
	}
	return e.Message
}
type Attrs map[string]string