avoid double escaping

This commit is contained in:
Andre Medeiros 2022-05-07 11:08:10 -04:00
parent 8a8431fc0f
commit 8cdb8bb621

View file

@ -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)),
)
}