dannyvankooten / vat

Go package for dealing with EU VAT. Does VAT number validation & rates retrieval.
MIT License
111 stars 16 forks source link

let validateNumberFormat return if vatnumer is not EU #12

Open ChielTimmermans opened 4 years ago

ChielTimmermans commented 4 years ago

Is it possible that validateNumberFormat will return err when it cannot find the landcode in patterns? So change:

pattern, ok := patterns[n[0:2]]
if !ok {
    return false, nil
}

to

var CountryNotFound = errors.New("countryNotFound")

pattern, ok := patterns[n[0:2]]
if !ok {
    return false, CountryNotFound
}