Getting Started
Install
go get github.com/floatpane/go-emoji-shortcode
Requires Go 1.26+.
Look up an emoji
package main
import (
"fmt"
"log"
"github.com/floatpane/go-emoji-shortcode"
)
func main() {
em, ok := shortcode.Lookup("smile")
if !ok {
log.Fatal("unknown shortcode")
}
fmt.Println(em) // 😄
}
Suggest matching shortcodes
matches := shortcode.Suggest("sm")
for _, m := range matches {
fmt.Printf(":%s: -> %s\n", m.Code, m.Emoji)
}
// :smile: -> 😄
// :smirk: -> 😏
// ...
Next steps
- Lookup — exact shortcode to emoji conversion.
- Suggest — fuzzy prefix matching with preview.
- Render shortcodes — replacing
:shortcode:in text bodies.