Skip to content

Commit

Permalink
Remove padding
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblum committed Apr 14, 2020
1 parent 73b0214 commit a1b3d26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions emoji.go
Expand Up @@ -12,11 +12,6 @@ import (

//go:generate generateEmojiCodeMap -pkg emoji

// Replace Padding character for emoji.
const (
ReplacePadding = " "
)

// CodeMap gets the underlying map of emoji.
func CodeMap() map[string]string {
return emojiCodeMap
Expand Down Expand Up @@ -52,7 +47,7 @@ var flagRegexp = regexp.MustCompile(":flag-([a-z]{2}):")
func emojize(x string) string {
str, ok := emojiCodeMap[x]
if ok {
return str + ReplacePadding
return str
}
if match := flagRegexp.FindStringSubmatch(x); len(match) == 2 {
return regionalIndicator(match[1][0]) + regionalIndicator(match[1][1])
Expand Down
2 changes: 1 addition & 1 deletion emoji_test.go
Expand Up @@ -29,7 +29,7 @@ func TestFlag(t *testing.T) {

func TestPlusOne(t *testing.T) {
f := emojize(plusOne)
expected := "\U0001f44d "
expected := "\U0001f44d"
if f != expected {
t.Error("emojize ", f, "!=", expected)
}
Expand Down

0 comments on commit a1b3d26

Please sign in to comment.