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.
goverify/README.md

60 lines
1.6 KiB

2 years ago
<h1>
<a href="https://www.dtapp.net/">Golang Verify</a>
</h1>
2 years ago
📦 Golang 验证
2 years ago
[comment]: <> (go)
2 years ago
[![godoc](https://pkg.go.dev/badge/go.dtapp.net/goverify?status.svg)](https://pkg.go.dev/go.dtapp.net/goverify)
[![goproxy.cn](https://goproxy.cn/stats/go.dtapp.net/goverify/badges/download-count.svg)](https://goproxy.cn/stats/go.dtapp.net/goverify)
[![goreportcard.com](https://goreportcard.com/badge/go.dtapp.net/goverify )](https://goreportcard.com/report/go.dtapp.net/goverify)
[![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/go.dtapp.net%2Fgoverify)
2 years ago
2 years ago
#### 安装
2 years ago
5 months ago
```shell
go get -v -u go.dtapp.net/goverify@v1.0.8
2 years ago
```
2 years ago
#### 使用
```go
package main
2 years ago
import (
2 years ago
"go.dtapp.net/goverify"
2 years ago
"testing"
2 years ago
)
2 years ago
2 years ago
// TestChinaMobile 验证手机号码
2 years ago
func TestChinaMobile(t *testing.T) {
t.Log(goverify.ChinaMobile("13800138000"))
}
2 years ago
// 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"))
}
2 years ago
```
2 years ago