Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1015 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 1015 Bytes

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