func str(n int64) string {
	return strconv.FormatInt(n, 10)
}
Str convert int64 to string.
package wechat
import (
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
	"os"
	"regexp"
	"strconv"
	"strings"
	"time"
)
func search(source, prefix, suffix string) (string, error) {
	index := strings.Index(source, prefix)
	if index == -1 {
		err := fmt.Errorf("can't find [%s] in [%s]", prefix, source)
		return ``, err
	}
	index += len(prefix)
	end := strings.Index(source[index:], suffix)
	if end == -1 {
		err := fmt.Errorf("can't find [%s] in [%s]", suffix, source)
		return ``, err
	}
	result := source[index : index+end]
	return result, nil
}
func replaceEmoji(oriStr string) string {
	newStr := oriStr
	if strings.Contains(oriStr, `<span class="emoji`) {
		reg, _ := regexp.Compile(`<span class="emoji emoji[a-f0-9]{5}"></span>`)
		newStr = reg.ReplaceAllStringFunc(oriStr, func(arg2 string) string {
			num := `'\U000` + arg2[len(arg2)-14:len(arg2)-9] + `'`
			emoji, err := strconv.Unquote(num)
			if err == nil {
				return emoji
			}
			return num
		})
	}
	return newStr
}
func createFile(name string, data []byte, isAppend bool) (err error) {
	defer func() {
		if err != nil {
			logger.Error(err)
		}
	}()
	oflag := os.O_CREATE | os.O_WRONLY
	if isAppend {
		oflag |= os.O_APPEND
	} else {
		oflag |= os.O_TRUNC
	}
	file, err := os.OpenFile(name, oflag, 0666)
	if err != nil {
		return
	}
	defer file.Close()
	_, err = file.Write(data)
	return
}
func now() string {
	return str(time.Now().Unix())
}