Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

sshaplygin/docs-code

Repository files navigation

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

AltStyle によって変換されたページ (->オリジナル) /