golang-design / under-the-hood

📚 Go: Under The Hood | Go 语言原本 | https://golang.design/under-the-hood

Home Page:https://golang.design/under-the-hood

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

对类型别名的举例有错误

developerdong opened this issue · comments

实际描述

预期描述

type Alias = Origin

错误原因

如果是别名的话,应该是type A = B这种形式,而不是type A B这种形式。
像原文中type New Old这种形式,实际上New是一个新的type,Old只是New的底层类型(underlying type)。