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()") }