You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
continuous-integration/drone/push Build is passing
Details
|
10 months ago | |
---|---|---|
.drone.yml | 11 months ago | |
.gitignore | 10 months ago | |
LICENSE | 11 months ago | |
README.md | 10 months ago | |
get.go | 10 months ago | |
get_test.go | 10 months ago | |
go.mod | 11 months ago | |
gopreg.go | 10 months ago | |
gopreg_test.go | 10 months ago | |
version.go | 10 months ago | |
version_test.go | 1 year ago |
README.md
Golang Verify
📦 Golang 验证
安装
go get -v -u go.dtapp.net/goverify
使用
package main
import (
"go.dtapp.net/goverify"
"testing"
)
// TestChinaMobile 验证手机号码
func TestChinaMobile(t *testing.T) {
t.Log(goverify.ChinaMobile("13800138000"))
}
// TestChinaMobileNumber 验证中国移动手机号码
func TestChinaMobileNumber(t *testing.T) {
t.Log(goverify.ChinaMobileNumber("13800138000"))
}
// TestChinaUnicomNumber 验证中国联通手机号码
func TestChinaUnicomNumber(t *testing.T) {
t.Log(goverify.ChinaUnicomNumber("13800138000"))
}
// TestChinaTelecomNumber 验证中国电信手机号码
func TestChinaTelecomNumber(t *testing.T) {
t.Log(goverify.ChinaTelecomNumber("13800138000"))
}
// TestChinaBroadnetNumber 验证中国广电手机号码
func TestChinaBroadnetNumber(t *testing.T) {
t.Log(goverify.ChinaBroadnetNumber("13800138000"))
}
// TestChinaVirtualNumber 验证虚拟运营商手机号码
func TestChinaVirtualNumber(t *testing.T) {
t.Log(goverify.ChinaVirtualNumber("13800138000"))
}