Skip to content

fix: accept Nigeria's 11-character postcodes - #1664

Merged
nodivbyzero merged 2 commits into
go-playground:masterfrom
Adeniyikayodee:fix/ng-digital-postcode
Oct 9, 2026
Merged

nodivbyzero merged 2 commits into
go-playground:masterfrom
Adeniyikayodee:fix/ng-digital-postcode

Conversation

@Adeniyikayodee

Copy link
Copy Markdown
Contributor

Fixes Or Enhances

NIPOST launched a new postcode for Nigeria in October 2026. It has 11 characters in five segments, for example EK-01-A03-FK-01: two letters, two digits, three letters or digits, two letters, and two digits. The two numeric segments run from 01 to 99.

postcode_iso3166_alpha2=NG accepted six digits only, so every new code was rejected. The rule now accepts both. The new code may be written with hyphens, with spaces, or with no separator, in upper case like the other rules in the file.

Format reference: https://docs.postcode.gov.ng/concepts/postcode-format

go test ./... and go vet ./... pass on Go 1.27.1.

This change was prepared with AI assistance (Claude) and reviewed by me.

Make sure that you've checked the boxes below before you submit PR:

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Adeniyikayodee
Adeniyikayodee requested a review from a team as a code owner October 8, 2026 08:47
@Adeniyikayodee

Copy link
Copy Markdown
Contributor Author

@nodivbyzero, I would be grateful if you could look at this whenever your time allows. Nigeria launched a new national postcode on 1 October, and the NG rule still accepts only the six-digit code it replaces, so every new code fails postcode_iso3166_alpha2. The format and its source are in the description, and the tests cover both codes. I am glad to change anything that would make this easier to merge. Thank you for the work you put into this library, and please take it at your own pace.

Comment thread validator_test.go
@Adeniyikayodee
Adeniyikayodee force-pushed the fix/ng-digital-postcode branch from 51300d5 to a37c290 Compare October 9, 2026 00:00
@nodivbyzero
nodivbyzero merged commit e309812 into go-playground:master Oct 9, 2026
7 checks passed
@Adeniyikayodee

Copy link
Copy Markdown
Contributor Author

Thank you, @nodivbyzero, for the review and the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants