It is validator about official of documents codes in Go
It is not production ready public API! It is API could be change it the future. To be attentive for this.
Status of implementation by code package:
- OKATO
- Generate method
- Validate method
Full supported codes: BIK, INN, KPP, OGRN, OGRNIP, SNILS
go get github.com/sshaplygin/docs-code
import (
"log"
"github.com/sshaplygin/docs-code"
)
...
isValid, err := docs_code.Validate(docs_code.INN, "526317984689")
if err != nil {
log.Error(err)
}
if !isValid {
log.Println("INN is invalid")
} else {
log.Println("INN is valid")
}