4829ea0e9f
Use shortid.MustGenerate() instead of shortid.Generate(). Instead of returning errors it will panic.
16 lines
271 B
Go
16 lines
271 B
Go
package util
|
|
|
|
import (
|
|
"github.com/teris-io/shortid"
|
|
)
|
|
|
|
func init() {
|
|
gen, _ := shortid.New(1, shortid.DefaultABC, 1)
|
|
shortid.SetDefault(gen)
|
|
}
|
|
|
|
// GenerateShortUid generates a short unique identifier.
|
|
func GenerateShortUid() string {
|
|
return shortid.MustGenerate()
|
|
}
|