From 78decca57800b4366aa19fed0f13f69a553e77cf Mon Sep 17 00:00:00 2001 From: Shikong <919411476@qq.com> Date: Fri, 24 Sep 2021 01:27:31 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=87=AA=E5=AE=9A=E4=B9=89=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E3=80=81=E7=B1=BB=E5=9E=8B=E5=88=AB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/function/type/main.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/base/function/type/main.go b/base/function/type/main.go index 2f983b8..51cddc2 100644 --- a/base/function/type/main.go +++ b/base/function/type/main.go @@ -5,6 +5,14 @@ import ( "strconv" ) +// 自定义 新类型 +// 自定义类型 编译后 依然存在 +type myInt int + +// 类型别名 +// 类型别名 编译后 定义的 类型别名将不存在 变为 别名对应的类型 只存在于代码中 +type aliasInt = int + func f1() { fmt.Println("exec f1()") }