Skip to content

Commit 7490de4

Browse files
authored
Init post codes regexes
Fixed an issue where the post codes regexes would not get initialised for postcode_iso3166_alpha2_field validation.
1 parent 6c3307e commit 7490de4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

baked_in.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,7 @@ func isPostcodeByIso3166Alpha2Field(fl FieldLevel) bool {
14171417
panic(fmt.Sprintf("Bad field type %T", currentField.Interface()))
14181418
}
14191419

1420+
postcodeRegexInit.Do(initPostcodes)
14201421
reg, found := postCodeRegexDict[currentField.String()]
14211422
if !found {
14221423
return false

0 commit comments

Comments
 (0)