func (c *PubSub) PSubscribe(patterns ...string) error {
	err := c.subscribe("PSUBSCRIBE", patterns...)
	if err == nil {
		c.patterns = append(c.patterns, patterns...)
		c.nsub += len(patterns)
	}
	return err
}
Subscribes the client to the given patterns.
package redis
import (
	"fmt"
	"net"
	"time"
	"gopkg.in/redis.v3/internal"
	"gopkg.in/redis.v3/internal/pool"
)
func (c *Client) Publish(channel, message string) *IntCmd {
	req := NewIntCmd("PUBLISH", channel, message)
	c.Process(req)
	return req
}
type PubSub struct {
	base *baseClient
	channels []string
	patterns []string
	nsub int  
}
func (c *Client) PubSub() *PubSub {
	return &PubSub{
		base: &baseClient{
			opt:      c.opt,
			connPool: pool.NewStickyConnPool(c.connPool.(*pool.ConnPool), false),
		},
	}
}
func (c *Client) Subscribe(channels ...string) (*PubSub, error) {
	pubsub := c.PubSub()
	return pubsub, pubsub.Subscribe(channels...)
}
func (c *Client) PSubscribe(channels ...string) (*PubSub, error) {
	pubsub := c.PubSub()
	return pubsub, pubsub.PSubscribe(channels...)
}
func (c *PubSub) subscribe(redisCmd string, channels ...string) error {
	cn, err := c.base.conn()
	if err != nil {
		return err
	}
	c.putConn(cn, err)
	args := make([]interface{}, 1+len(channels))
	args[0] = redisCmd
	for i, channel := range channels {
		args[1+i] = channel
	}
	cmd := NewSliceCmd(args...)
	return writeCmd(cn, cmd)
}
func (c *PubSub) Subscribe(channels ...string) error {
	err := c.subscribe("SUBSCRIBE", channels...)
	if err == nil {
		c.channels = append(c.channels, channels...)
		c.nsub += len(channels)
	}
	return err
}