DEV Community

Enes Çakır
Enes Çakır

Posted on

Use Emojis in Go

#go

emoji is a minimalistic emoji package for Go. It makes emoji usage easier.
You don't have to remember emoji names. Your IDE's autocomplete feature handles it.

GitHub logo enescakir / emoji

A minimalistic emoji package for Go (golang)

Usage

package main

import (
    "fmt"

    "github.com/enescakir/emoji"
)

func main() {
    fmt.Printf("Hello %v\n", emoji.WavingHand)
    fmt.Printf("I am %v from %v\n",
        emoji.ManTechnologist,
        emoji.FlagForTurkey,
    )
    fmt.Printf("Different skin tones.\n  default: %v light: %v dark: %v\n",
        emoji.ThumbsUp,
        emoji.OkHand.Tone(emoji.Light),
        emoji.CallMeHand.Tone(emoji.Dark),
    )
    fmt.Printf("Emojis with multiple skin tones.\n  both medium: %v light and dark: %v\n",
        emoji.PeopleHoldingHands.Tone(emoji.Medium),
        emoji.PeopleHoldingHands.Tone(emoji.Light, emoji.Dark),
    )
}

/* OUTPUT

    Hello 👋
    I am 👨‍💻 from 🇹🇷
    Different skin tones.
      default: 👍 light: 👌🏻 dark: 🤙🏿
    Emojis with multiple skin tones.
      both medium: 🧑🏽‍🤝‍🧑🏽 light and dark: 🧑🏻‍🤝‍🧑🏿

*/

Top comments (4)

Collapse
 
fista2 profile image
austinchase • Edited

It is not necessary to have an emoji keyboard loaded to access the handcuff sign on a desktop pc or a smartphone device. Find the image of the emoji that you want to use on any site by looking at its image or its significance, then click or touch on it to copy it to the clipboard. Once you have done so, go to a different site or app and enter the emoji just as you would any other data.
emojisvilla.com/handcuff-emoji/

Collapse
 
x777 profile image
YD

Supports Goland?

Collapse
 
enescakir profile image
Enes Çakır • Edited

You can use it with any IDE. It's not special or new feature. It's basic code completion.

Goland

Collapse
 
x777 profile image
YD

I mean about preview. For example, Goland not shows emojis (smiles) in editor.