trid

package module
v0.0.0-...-61ddfc2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 3 Imported by: 0

README

Turkish Identification Number Validator

A library to validate Turkish identification number. It provides 2 functions.

Example

id := "43848743180"
if !trid.Valid() {
    log.Printf("id is not valid")
}

If you want more details about the error use Validate function instead:

id := "43848743180"
if err := trid.Validate(); err!=nil {
    log.Printf("id is not valid: %s", err.Error())
}

References

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Valid

func Valid(id string) bool

Valid returns if the id is valid. It is a convenience function to easily get the bool result of the validation.

func Validate

func Validate(id string) error

Validate validates the id and returns an error if it is not valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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