From f5320f2ecbfd915af4e13a28c34e7b736e62ad16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?France=CC=81=20Wilke?= <francewilke@gmail.com> Date: Fri, 8 Sep 2023 09:02:31 +0200 Subject: [PATCH] Add a check for a province code match --- address_utils/address_utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/address_utils/address_utils.go b/address_utils/address_utils.go index 375c156..190b545 100644 --- a/address_utils/address_utils.go +++ b/address_utils/address_utils.go @@ -242,7 +242,8 @@ func CleanZone(countryToClean, zoneToClean *string) (newCountry, newZone *string for provinceCode, province := range Provinces { found := false for _, name := range province.Names { - if strings.ToLower(zone) == strings.ToLower(string_utils.RemoveAllWhiteSpaces(name)) { + if strings.ToLower(zone) == strings.ToLower(string_utils.RemoveAllWhiteSpaces(name)) || + strings.ToLower(zone) == strings.ToLower(provinceCode) { zone = provinceCode found = true break -- GitLab