Micro check library in Golang.
go get github.com/bbrodriges/is
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
}
package main
import "github.com/bbrodriges/is"
func main() {
is.Email("[email protected]") // true
is.Numeric("Ⅸ") // false
is.UTFNumeric("Ⅸ") // true
}
for more documentation godoc
If application speed is important to you as for me, you can check out benchmarks in every Travis CI build.
- Report problems
- Add/Suggest new features/recipes
- Improve/fix documentation
Original project:
- alioygur/is Micro check library
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.