Skip to content

Commit

Permalink
This PR is opened to fix issue #4
Browse files Browse the repository at this point in the history
Add a check if the Pincode is valid or not.

[Source-wiki] A Postal Index Number (PIN), or sometimes PIN code
refers to a six-digit code in the Indian postal code system used
by India Post.

Signed-off-by: SushilG96 <[email protected]>
  • Loading branch information
SushilG96 committed May 4, 2021
1 parent 1b7f13c commit 41482d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func checkFlags() error {
if len(pinCode) == 0 && (len(state) == 0 || len(district) == 0) {
return errors.New("Missing state or district name option")
}
if len(pinCode) != 6 {
return errors.New("Invalid pincode")
}
if age == 0 {
return errors.New("Missing age option")
}
Expand Down

0 comments on commit 41482d5

Please sign in to comment.