Skip to content

bbrodriges/is

 
 

Repository files navigation

is

Build Status GoDoc Go Report Card Coverage Status

Micro check library in Golang.

Installation

go get github.com/bbrodriges/is

No regexs as much as possible

It works with runes, basic operations (loops, conditions etc) and standart library functions as long as is it possible. Part of source code:

// Alpha check if the string contains only letters (a-zA-Z).
func Alpha(s string) bool {
	if len(s) == 0 {
		return false
	}

	for _, v := range s {
		if ('Z' < v || v < 'A') && ('z' < v || v < 'a') {
			return false
		}
	}
	return true
}

Usage

package main

import "github.com/bbrodriges/is"

func main()  {
    is.Email("[email protected]") // true
    is.Numeric("Ⅸ") // false
    is.UTFNumeric("Ⅸ") // true
}

for more documentation godoc

Benchmarks

If application speed is important to you as for me, you can check out benchmarks in every Travis CI build.

Contribute

  • Report problems
  • Add/Suggest new features/recipes
  • Improve/fix documentation

Thanks & Authors

Original project:

Main differences

This fork has been created because of:

  • Some fundamental disagreements with author of original repo
  • Unpleasant amount of regular expressions in code.

One of main goals of this repo is to fix all of the above claims.

About

Micro check library in Golang.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%