From 5d5327614d1ad03fb6110c80bed1fa945376cbb4 Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Thu, 2 Sep 2021 12:24:18 +0200 Subject: [PATCH] lint --- internal/regexes/regexes.go | 28 +++++++++++++-------------- internal/validate/formvalidation.go | 4 ++-- internal/validate/structvalidation.go | 4 +++- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/internal/regexes/regexes.go b/internal/regexes/regexes.go index 53446ff2c..8ac31ef62 100644 --- a/internal/regexes/regexes.go +++ b/internal/regexes/regexes.go @@ -24,20 +24,20 @@ ) 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 index a30ec1a58..9f61578e7 100644 --- a/internal/validate/formvalidation.go +++ b/internal/validate/formvalidation.go @@ -38,8 +38,8 @@ 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 index 7717822d9..3c7a4abd9 100644 --- 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.