From 651103bdda26e248c427a16b49a54e8313c28150 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 15 Feb 2018 14:56:52 +0100 Subject: [PATCH] chore: adds comment for exported function --- pkg/util/shortid_generator.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/util/shortid_generator.go b/pkg/util/shortid_generator.go index ca65902e869..f2d9faa61c8 100644 --- a/pkg/util/shortid_generator.go +++ b/pkg/util/shortid_generator.go @@ -14,6 +14,12 @@ var validUidPattern = regexp.MustCompile(`^[a-zA-Z0-9\-\_]*$`).MatchString var ErrDashboardInvalidUid = errors.New("uid contains illegal characters") var ErrDashboardUidToLong = errors.New("uid to long. max 40 characters") +func init() { + gen, _ := shortid.New(1, allowedChars, 1) + shortid.SetDefault(gen) +} + +// VerifyUid verifies the size and content of the uid func VerifyUid(uid string) error { if len(uid) > 40 { return ErrDashboardUidToLong @@ -26,11 +32,6 @@ func VerifyUid(uid string) error { return nil } -func init() { - gen, _ := shortid.New(1, allowedChars, 1) - shortid.SetDefault(gen) -} - // GenerateShortUid generates a short unique identifier. func GenerateShortUid() string { return shortid.MustGenerate()