Skip to content

Instantly share code, notes, and snippets.

View timchunght's full-sized avatar

Timothy Chung timchunght

View GitHub Profile
@knation
knation / object_ids.go
Last active January 29, 2022 20:45
Example of object ID management in Golang (uses ksuid)
// Used to create, manage, and parse unique IDs. This code creates stripe-like IDs,
// (e.g., xx_000000000000000000000000000). It allows for a prefix and a 27
// character ksuid separated by an underscore. The prefix makes it easy
// to visibly identify what the ID is for.
//
// Author: Kirk Morales
package util
import (