From 34150d18fd812de084a2a7800b4aeeab4e70b360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Thu, 4 Aug 2022 14:46:50 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E5=A2=9E=E5=8A=A0[=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=BF=90=E8=90=A5=E5=95=86=E7=B1=BB=E5=9E=8B=E5=90=8D=E7=A7=B0?= =?UTF-8?q?]=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get.go | 15 +++++++++++++++ get_test.go | 7 +++++++ version.go | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 get.go create mode 100644 get_test.go diff --git a/get.go b/get.go new file mode 100644 index 0000000..8ab6766 --- /dev/null +++ b/get.go @@ -0,0 +1,15 @@ +package goverify + +// 功能类型 +var typeName = map[string]string{ + Mobile: "移动", + Unicom: "联通", + Telecom: "电信", + Broadnet: "广电", + Virtual: "虚拟", +} + +// GetTypeName 获取运营商类型名称 +func GetTypeName(Type string) string { + return typeName[Type] +} diff --git a/get_test.go b/get_test.go new file mode 100644 index 0000000..bf13aa4 --- /dev/null +++ b/get_test.go @@ -0,0 +1,7 @@ +package goverify + +import "testing" + +func TestGetTypeName(t *testing.T) { + t.Log(GetTypeName(Mobile)) +} diff --git a/version.go b/version.go index 3fd86bd..80a395d 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,3 @@ package goverify -const Version = "1.0.5" +const Version = "1.0.6"