Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 2.36 KB

README.md

File metadata and controls

57 lines (39 loc) · 2.36 KB

docs-code

GoDoc Go Coverage License Go Report Card

It is validator about official of documents codes in Go

Alert

It is not production ready public API! It is API could be change it the future. To be attentive for this.

Status

Status of implementation by code package:

  • OKATO
    • Generate method
    • Validate method

Full supported codes: BIK, INN, KPP, OGRN, OGRNIP, SNILS

Usage

go get github.com/sshaplygin/docs-code

Example

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")
}

Documentation