> For the complete documentation index, see [llms.txt](https://golang-2.gitbook.io/handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://golang-2.gitbook.io/handbook/ji-chu/lei-xing/zi-ding-yi-lei-xing.md).

# 自定义类型

可以将各种内置类型重新定义命名为新的类型名称，该类型就称为自定义类型

例子：定义自定义类型

```go
package main

import (
	"fmt"
)

// 通过int64自定义Long类型
type Long int64

func main() {
	// 通过自定义类型Long定义并赋值变量long
	var long Long = 231231231
	fmt.Println(long)
}
```

以上代码的执行结果：

```
231231231
```
