From 7490de4f45f7e74bb10f8183578c4a8c2450518f Mon Sep 17 00:00:00 2001 From: Daan Oosting Date: Mon, 6 Jan 2025 10:34:12 +0100 Subject: [PATCH] Init post codes regexes Fixed an issue where the post codes regexes would not get initialised for postcode_iso3166_alpha2_field validation. --- baked_in.go | 1 + 1 file changed, 1 insertion(+) diff --git a/baked_in.go b/baked_in.go index 2f66c1836..dab60f18f 100644 --- a/baked_in.go +++ b/baked_in.go @@ -1417,6 +1417,7 @@ func isPostcodeByIso3166Alpha2Field(fl FieldLevel) bool { panic(fmt.Sprintf("Bad field type %T", currentField.Interface())) } + postcodeRegexInit.Do(initPostcodes) reg, found := postCodeRegexDict[currentField.String()] if !found { return false