sort.Strings排序默认是按照Unicode码点的顺序的, 如果需要按照拼音排序, 可以通过GBK转换实现, 自定义一个排序接口, 代码如下:

package main

import (
    "bytes"
    "fmt"
    "io/ioutil"
    "sort"

    "golang.org/x/text/encoding/simplifiedchinese"
    "golang.org/x/text/transform"
)

//ByPinyin is customized sort interface to sort string by Chinese PinYin
type ByPinyin []string

func (s ByPinyin) Len() int      { return len(s) }
func (s ByPinyin) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
func (s ByPinyin) Less(i, j int) bool {
    a, _ := UTF82GBK(s[i])
    b, _ := UTF82GBK(s[j])
    bLen := len(b)
    for idx, chr := range a {
        if idx > bLen-1 {
            return false
        }
        if chr != b[idx] {
            return chr < b[idx]
        }
    }
    return true
}

//UTF82GBK : transform UTF8 rune into GBK byte array
func UTF82GBK(src string) ([]byte, error) {
    GB18030 := simplifiedchinese.All[0]
    return ioutil.ReadAll(transform.NewReader(bytes.NewReader([]byte(src)), GB18030.NewEncoder()))
}

//GBK2UTF8 : transform  GBK byte array into UTF8 string
func GBK2UTF8(src []byte) (string, error) {
    GB18030 := simplifiedchinese.All[0]
    bytes, err := ioutil.ReadAll(transform.NewReader(bytes.NewReader(src), GB18030.NewDecoder()))
    return string(bytes), err
}

func main() {
    b := []string{"哈", "呼", "嚯", "ha", ","}

    sort.Strings(b)
    //output: [, ha 呼 哈 嚯]
    fmt.Println("Default sort: ", b)

    sort.Sort(ByPinyin(b))
    //output: [, ha 哈 呼 嚯]
    fmt.Println("By Pinyin sort: ", b)
}