From 8cdb8bb621eb1464d53b69f7056eb7854a091e92 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Sat, 7 May 2022 11:08:10 -0400 Subject: [PATCH] avoid double escaping --- internal/domain/subreddit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/domain/subreddit.go b/internal/domain/subreddit.go index 5727264..9c06797 100644 --- a/internal/domain/subreddit.go +++ b/internal/domain/subreddit.go @@ -23,7 +23,7 @@ func (sr *Subreddit) NormalizedName() string { func (sr *Subreddit) Validate() error { return validation.ValidateStruct(sr, - validation.Field(&sr.Name, validation.Required, validation.Length(3, 32), validation.Match(regexp.MustCompile("^(?!u_)[a-zA-Z0-9]\\w{1,19}$"))), + validation.Field(&sr.Name, validation.Required, validation.Length(3, 32), validation.Match(regexp.MustCompile(`^(?!u_)[a-zA-Z0-9]\w{1,19}$`))), validation.Field(&sr.SubredditID, validation.Required, validation.Length(4, 9)), ) }