all repos — emoji @ 8ea91c818c0d82e9c2bd6d55e8032ab801e3180c

A minimalistic emoji package for Go (golang)

README.md (view raw)

 1# emoji :rocket: :school_satchel: :tada:
 2[![godoc](https://godoc.org/github.com/enescakir/emoji?status.svg)](https://godoc.org/github.com/enescakir/emoji)
 3
 4`emoji` is a minimalistic emoji library for Go. It lets you use emoji characters in strings.
 5
 6Inspired by [spatie/emoji](https://github.com/spatie/emoji)
 7
 8## Install :floppy_disk:
 9``` bash
10go get github.com/enescakir/emoji
11```
12
13## Usage :surfer:
14```go
15package main
16
17import (
18    "fmt"
19
20    "github.com/enescakir/emoji"
21)
22
23func main() {
24    fmt.Printf("hello %v from %v\n", 
25        emoji.WavingHand, 
26        emoji.FlagsForFlagTurkey,
27    )
28    fmt.Printf("different skin tones. default: %v light: %v dark: %v\n", 
29        emoji.ThumbsUp,
30        emoji.OkHand.Tone(emoji.Light),
31        emoji.CallMeHand.Tone(emoji.Dark),
32    )
33    fmt.Printf("emoji with multiple skins: %v\n", 
34        emoji.PeopleHoldingHands.Tone(emoji.Light, emoji.Dark),
35    )
36}
37
38/* OUTPUT
39
40    hello 👋 from 🇹🇷
41    different skin tones. default: 👍 light: 👌🏻 dark: 🤙🏿
42    emoji with multiple skins: 🧑🏻‍🤝‍🧑🏿
43
44*/
45```
46
47This package contains Full Emoji List v12.0 based on [https://unicode.org/Public/emoji/12.0/emoji-test.txt](https://unicode.org/Public/emoji/12.0/emoji-test.txt).
48
49Also, you can generate country flag emoji with [ISO 3166 Alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) codes:
50```go
51emoji.CountryFlag("tr") // 🇹🇷
52```
53
54## Testing :hammer:
55``` bash
56go test
57```
58
59## Todo :pushpin:
60* Add `godoc`
61* Add badges to README
62* Add benchmarks
63* Add emoji constant generator
64
65## Contributing :man_technologist:
66I am accepting PRs that add characters to the class.
67Please use [this list](http://unicode.org/emoji/charts/full-emoji-list.html) to look up the unicode value and the name of the character.
68
69## Credits :star:
70- [Enes Çakır](https://github.com/enescakir)
71
72## License :scroll:
73The MIT License (MIT). Please see [License File](LICENSE.md) for more information.