Skip to content

Installation

  • Go 1.26 or later
  • An active Go module (go.mod)

Run this in your project directory:

Terminal window
go get github.com/larsartmann/go-branded-id
package main
import (
"fmt"
"github.com/larsartmann/go-branded-id"
)
type UserBrand struct{}
type UserID = id.ID[UserBrand, string]
func main() {
userID := id.NewID[UserBrand]("user-123")
fmt.Println(userID.Get()) // user-123
}
Terminal window
go list -m github.com/larsartmann/go-branded-id