Skip to content

go-cnpj is a lightweight and simple lib for validating the Brazilian National Register of Legal Entities (CNPJ)

License

Notifications You must be signed in to change notification settings

kaduartur/go-cnpj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

test codecov CodeFactor

go-cnpj

go-cnpj is a lightweight and simple lib for validating the Brazilian National Register of Legal Entities (CNPJ)

💾 How to install?

Run the go get command in terminal:

go get github.com/kaduartur/go-cnpj

💻 How to use this?

To use the lib you have to import the package into the file you want:

package main

import "github.com/kaduartur/go-cnpj/cnpj"

func main() {
	if err := cnpj.IsValid("79.276.501/0001-55"); err != nil {
		panic(err)
	}

	if err := cnpj.IsValid("79276501000155"); err != nil {
		panic(err)
	}
}