gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 5d5327614d1ad03fb6110c80bed1fa945376cbb4
parent cc7a35ee9299750667a5e53542c285ca05634706
Author: tsmethurst <tobi.smethurst@klarrio.com>
Date:   Thu,  2 Sep 2021 12:24:18 +0200

lint

Diffstat:
Minternal/regexes/regexes.go | 28++++++++++++++--------------
Minternal/validate/formvalidation.go | 4++--
Minternal/validate/structvalidation.go | 4+++-
3 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/internal/regexes/regexes.go b/internal/regexes/regexes.go @@ -24,20 +24,20 @@ import ( ) const ( - users = "users" - actors = "actors" - statuses = "statuses" - inbox = "inbox" - outbox = "outbox" - followers = "followers" - following = "following" - liked = "liked" - collections = "collections" - featured = "featured" - publicKey = "main-key" - follow = "follow" - update = "updates" - blocks = "blocks" + users = "users" + actors = "actors" + statuses = "statuses" + inbox = "inbox" + outbox = "outbox" + followers = "followers" + following = "following" + liked = "liked" + // collections = "collections" + // featured = "featured" + publicKey = "main-key" + follow = "follow" + // update = "updates" + blocks = "blocks" ) const ( diff --git a/internal/validate/formvalidation.go b/internal/validate/formvalidation.go @@ -38,8 +38,8 @@ const ( maximumDescriptionLength = 5000 maximumSiteTermsLength = 5000 maximumUsernameLength = 64 - maximumEmojiShortcodeLength = 30 - maximumHashtagLength = 30 + // maximumEmojiShortcodeLength = 30 + // maximumHashtagLength = 30 ) // NewPassword returns an error if the given password is not sufficiently strong, or nil if it's ok. diff --git a/internal/validate/structvalidation.go b/internal/validate/structvalidation.go @@ -46,7 +46,9 @@ func ulidValidator(fl validator.FieldLevel) bool { func init() { v = validator.New() - v.RegisterValidation("ulid", ulidValidator) + if err := v.RegisterValidation("ulid", ulidValidator); err != nil { + panic(err) + } } // Struct validates the passed struct, returning validator.ValidationErrors if invalid, or nil if OK.