Workflow Go Report Card Go Reference Go Version Release License Stars

golidators

Golidators is a golang package, it includes basic data validation functions and regexes. Also available on pkg.go.dev and github.com

Install

1
$ go get github.com/eredotpkfr/golidators

Overview

Following validators available on this package:

Usage

Just import and use it. Also see documentation at pkg.go.dev

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

import (
    "github.com/eredotpkfr/golidators"
    "fmt"
)

func main() {
  fmt.Println(golidators.Domain("www.example.com"))
  // true
  fmt.Println(golidators.Ipv4("::1"))
  // false
  fmt.Println(golidators.Ipv6("::1"))
  // true
  fmt.Println(golidators.Url("https://www.example.com"))
  // true
  fmt.Println(golidators.Ipv4Cidr("127.0.0.1/12"))
  // true
  fmt.Println(golidators.Md5("foo/bar"))
  // false
}

Contact

Blog - erdoganyoksul.com Mail - [email protected]