Skip to content

Commit

Permalink
This PR is opened to fix issue PrasadG193#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 3, 2021
1 parent 1b7f13c commit 67819ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func checkFlags() error {
len(district) == 0 {
return errors.New("Please pass one of the pinCode or state & district name combination options")
}
if len(pinCode) == 0 && (len(state) == 0 || len(district) == 0) {
return errors.New("Missing state or district name option")
if len(pinCode) == 6 && (len(state) == 0 || len(district) == 0) {
return errors.New("Missing pinCode or state and district name option")
}
if age == 0 {
return errors.New("Missing age option")
Expand Down

0 comments on commit 67819ad

Please sign in to comment.