pisvalidatior

package module
v1.0.1-0...-2217e7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 3 Imported by: 0

README

pisvalidator

Brazilian pis validator (PIS) - validation package in Golang.

It is an essential package to validate PIS number in your application.

Information about PIS

Installation

Use the go tool for do that:

$ go get github.com/Cegielkowski/pisvalidator

Usage

You need to import the package github.com/Cegielkowski/pisvalidator like that:

import (
    pisvalidator "github.com/Cegielkowski/pisvalidator"
)

Example

package main

import (
	"fmt"
	pisvalidator "github.com/Cegielkowski/pisvalidator"
)

func main() {

	// This will validate the PIS and clean the formatting.
	pis, err := pisvalidator.ValidatePis("477.11617.27-5")

	// Verifies if it is a valid PIS
	if err != nil {
		panic(fmt.Errorf("It isn't valid: %v", err))
	}

	// Formatted output
	fmt.Println(pis)
	// Output: 47711617275
}

License

License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidatePis

func ValidatePis(pis string) (string, error)

Validate the pis number.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL