From 18ad07d2f45c3f11ea70fa3fe8cfc349c778f02d Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 30 Sep 2022 21:55:51 +0800 Subject: [PATCH] :art: Clean code --- kernel/util/sort.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/util/sort.go b/kernel/util/sort.go index 170598bf8..19a91401c 100644 --- a/kernel/util/sort.go +++ b/kernel/util/sort.go @@ -39,13 +39,13 @@ func PinYinCompare(str1, str2 string) bool { return true } -// UTF82GBK : transform UTF8 rune into GBK byte array +// UTF82GBK transform UTF8 rune into GBK byte array. func UTF82GBK(src string) ([]byte, error) { GB18030 := simplifiedchinese.All[0] return io.ReadAll(transform.NewReader(bytes.NewReader([]byte(src)), GB18030.NewEncoder())) } -// GBK2UTF8 : transform GBK byte array into UTF8 string +// GBK2UTF8 transform GBK byte array into UTF8 string. func GBK2UTF8(src []byte) (string, error) { GB18030 := simplifiedchinese.All[0] bytes, err := io.ReadAll(transform.NewReader(bytes.NewReader(src), GB18030.NewDecoder()))