Files
grafana/pkg/util/shortid_generator.go
T
Marcus Efraimsson 4829ea0e9f util: remove retry logic in shortid_generator
Use shortid.MustGenerate() instead of shortid.Generate(). Instead
of returning errors it will panic.
2018-01-30 23:18:34 +01:00

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()
}