note: data from network, please use after identification.
go get -u github.com/dingdayu/phonedata
package main
import (
"fmt"
"github.com/dingdayu/phonedata"
)
func main() {
info, _ := phonedata.Find("13298181006")
fmt.Println(info)
}
at go 1.12, go models
file: example/main.go
go test -v -bench=".*" -benchmem -memprofile memprofile.out -cpuprofile cpuprofile.out
=== RUN TestIsPhone
--- PASS: TestIsPhone (0.00s)
=== RUN TestTotalRecord
--- PASS: TestTotalRecord (0.00s)
=== RUN TestVersion
--- PASS: TestVersion (0.00s)
=== RUN TestLoadDataFile
--- PASS: TestLoadDataFile (0.00s)
=== RUN Example
--- PASS: Example (0.00s)
goos: darwin
goarch: amd64
pkg: phonedata
BenchmarkIsPhone-4 200000 13505 ns/op 9209 B/op 114 allocs/op
BenchmarkVersion-4 300000000 5.21 ns/op 0 B/op 0 allocs/op
BenchmarkFind-4 3000000 449 ns/op 224 B/op 6 allocs/op
PASS
ok phonedata 6.922s
at: MacBook Pro(Intel Core i7/3.1 GHz)
The project is affected by the following projects or articles.