diff --git a/emoji.go b/emoji.go index f06745e..fd27dc0 100644 --- a/emoji.go +++ b/emoji.go @@ -294,7 +294,7 @@ func FormatEmoji(text string) string { } value := item[0] emojiCodeStr := item[1] - emojiCode, err := strconv.ParseInt(emojiCodeStr, 16, 16) + emojiCode, err := strconv.ParseInt(emojiCodeStr, 16, 64) if err != nil { continue } diff --git a/emoji_test.go b/emoji_test.go index cee544e..cfad054 100644 --- a/emoji_test.go +++ b/emoji_test.go @@ -6,7 +6,7 @@ import ( ) func TestFormatEmoji(t *testing.T) { - t.Log(FormatEmoji(`多吃点苹果`)) + t.Log(FormatEmoji(`多吃点苹果高兴 生气 点赞`)) } func TestSendEmoji(t *testing.T) { @@ -24,7 +24,7 @@ func TestSendEmoji(t *testing.T) { } func BenchmarkFormatEmojiString(b *testing.B) { - str := `多吃点苹果高兴 生气 点赞` + str := `多吃点苹果高兴 生气 点赞` b.SetBytes(int64(len(str))) // b.N会根据函数的运行时间取一个合适的值 for i := 0; i < b.N; i++ {