-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e05b93
commit 2b4ae07
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,42 @@ | ||
# CNJ_Validate | ||
Project created for verification of all information contained in CNJ format | ||
|
||
## Example | ||
|
||
``` | ||
package main | ||
import ( | ||
"fmt" | ||
"github.com/Darklabel91/CNJ_Validate" | ||
"github.com/Darklabel91/CNJ_Validate/Error" | ||
"github.com/Darklabel91/CNJ_Validate/Functions" | ||
) | ||
func main() { | ||
cnj := "1004144-88.2020.8.01.0037" | ||
//Returns true if the CNJ is valid and the validation digit that it should have | ||
bCNJ, nvd := Functions.ValidateCNJ(cnj) | ||
//Returns the valid CNJ in string format | ||
vCNJ := Functions.ReturnValidCNJ(cnj) | ||
//Returns a complex struct "AnalysisCNJ" with all the data in CNJ format; returns error if any step of the verification is faulted | ||
aCNJ, err := CNJ_Validate.AnalyzeCNJ(cnj) | ||
Error.CheckError(err) | ||
//Returns an organized string of all cnj attributes | ||
cnjW := CNJ_Validate.CNJWrite(aCNJ) | ||
fmt.Println("O CNJ existe?", bCNJ) | ||
fmt.Println("O dígito verificador correto:", nvd) | ||
fmt.Println("O CNJ correto seria:", vCNJ) | ||
fmt.Println("O cnj analisado:", aCNJ) | ||
fmt.Println(cnjW) | ||
} | ||
``` | ||
|