✏️ make lint happy

This commit is contained in:
fumiama
2021-12-19 17:43:46 +08:00
parent 67a493ee84
commit 596c75eeca
2 changed files with 10 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
package encode
package binary
import (
"bytes"
@@ -8,8 +8,8 @@ import (
"golang.org/x/text/transform"
)
// GBK 转 UTF-8
func GbkToUtf8(s []byte) ([]byte, error) {
// GBK2UTF8 GBK 转 UTF-8
func GBK2UTF8(s []byte) ([]byte, error) {
reader := transform.NewReader(bytes.NewReader(s), simplifiedchinese.GBK.NewDecoder())
d, e := ioutil.ReadAll(reader)
if e != nil {
@@ -18,8 +18,8 @@ func GbkToUtf8(s []byte) ([]byte, error) {
return d, nil
}
// UTF-8 转 GBK
func Utf8ToGbk(s []byte) ([]byte, error) {
// UTF82GBK UTF-8 转 GBK
func UTF82GBK(s []byte) ([]byte, error) {
reader := transform.NewReader(bytes.NewReader(s), simplifiedchinese.GBK.NewEncoder())
d, e := ioutil.ReadAll(reader)
if e != nil {