Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aliuygur/is
Micro check library in Golang.
https://github.com/aliuygur/is
golang micro validation validator
Last synced: 15 days ago
JSON representation
Micro check library in Golang.
- Host: GitHub
- URL: https://github.com/aliuygur/is
- Owner: aliuygur
- License: mit
- Created: 2016-08-31T14:49:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-08T10:27:51.000Z (almost 4 years ago)
- Last Synced: 2024-10-11T22:25:19.226Z (about 1 month ago)
- Topics: golang, micro, validation, validator
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 71
- Watchers: 7
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is
[![Build Status](https://travis-ci.org/alioygur/is.svg?branch=master)](https://travis-ci.org/alioygur/is)
[![GoDoc](https://godoc.org/github.com/alioygur/is?status.svg)](https://godoc.org/github.com/alioygur/is)
[![Go Report Card](https://goreportcard.com/badge/github.com/alioygur/is)](https://goreportcard.com/report/github.com/alioygur/is)Micro check library in Golang.
## Installation
`go get github.com/alioygur/is`
## Not only regex
It works with runes as long as is it possible.
Part of source code;
```go
// Alpha check if the string contains only letters (a-zA-Z). Empty string is valid.
func Alpha(s string) bool {
for _, v := range s {
if ('Z' < v || v < 'A') && ('z' < v || v < 'a') {
return false
}
}
return true
}
```## Usage
```go
package mainimport "github.com/alioygur/is"
import "log"func main() {
is.Email("[email protected]") // true
is.Numeric("Ⅸ") // false
is.UTFNumeric("Ⅸ") // true
}
```for more documentation [godoc](https://godoc.org/github.com/alioygur/is)
## Contribute
**we are waiting your contribution**
- Report problems
- Add/Suggest new features/recipes
- Improve/fix documentationMany thanks to our contributors: [contributors](https://github.com/alioygur/is/graphs/contributors)
## Thanks & Authors
I use code/got inspiration from these excellent libraries:
- [arasatasaygin/is.js](https://github.com/arasatasaygin/is.js) Micro check library
- [asaskevich/govalidator](https://github.com/asaskevich/govalidator) [Go] Package of validators and sanitizers for strings, numerics, slices and structs