EU VAT Number Validation Golang Package and Command Line Tool.
Verify the validity of a VAT number issued by any Member State.
$ euvv -num CZ28987373
VAT CZ28987373 is valid.
$ euvv -num CZ289873731
VAT CZ28987373 is invalid.
Exit codes:
- 0 - VAT number is valid.
- 1 - VAT number is invalid.
- 2 - Execution broken due to invalid command line parameters.
- 3 - Execution failed. See text message.
import (
"github.com/regorov/euvv"
)
validator := euvv.New(false, 3, false)
ok, err := validator.Validate("CZ28987373")
if err != nil {
fmt.Println(err)
return
}
if ok {
fmt.Println("Valid")
} else {
fmt.Println("Invalid")
}
- Intall Go www.golang.org
- $ go get github.com/regorov/euvv
- $ cd $GOPATH/src/github.com/regorov/euvv/cmd/euvv
- $ go build
- $ ./euvv -num CZ28987373
Partially generated via https://github.com/hooklift/gowsdl
MIT