当前位置:网站首页>golang 基础 —— 数据类型
golang 基础 —— 数据类型
2022-07-06 17:50:00 【猎人在吃肉】
1、数据类型
1)基本类型
- 数字
- 整数类型: int8、int16、int32、int64、unit8、unit16、unit32、unit64
- 浮点类型: float32、float64
- 其他数字类型
int: 32 或 64 位 uint: 32 或 64 位 byte: uint8 的类型别名 rune: int32 的类型别名 uintptr: 无符号整型,用于存放一个指针 - 布尔型(bool):只可以是常量 true 或者 false。
- 字符串(string)
2)复合类型
- 数组
- 结构体。通过组合简单类型,来表达更加复杂的数据结构。
3)引用类型
- 指针
- 切片(slice)
- map
- channel
- interface(接口)
- 函数类型
当声明引用类型的变量时,创建的变量被称作标头(header)值。
从技术细节上说, 字符串也是一种引用类型。
边栏推荐
- [Niuke] [noip2015] jumping stone
- Supersocket 1.6 creates a simple socket server with message length in the header
- 2022 Google CTF SEGFAULT LABYRINTH wp
- How to evaluate load balancing performance parameters?
- Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform
- Machine learning: the difference between random gradient descent (SGD) and gradient descent (GD) and code implementation.
- [signal and system]
- Grc: personal information protection law, personal privacy, corporate risk compliance governance
- 搭建【Redis in CentOS7.x】
- 实现mysql与ES的增量数据同步
猜你喜欢
随机推荐
2022 Google CTF SEGFAULT LABYRINTH wp
Share a general compilation method of so dynamic library
Go zero micro service practical series (IX. ultimate optimization of seckill performance)
Add the applet "lazycodeloading": "requiredcomponents" in taro,
Receive user input, height BMI, BMI detection small business entry case
MySQL script batch queries all tables containing specified field types in the database
2022 Google CTF SEGFAULT LABYRINTH wp
系统休眠文件可以删除吗 系统休眠文件怎么删除
Installation and testing of pyflink
Segmenttree
分享一个通用的so动态库的编译方法
云呐-工单管理制度及流程,工单管理规范
table表格设置圆角
实现mysql与ES的增量数据同步
从底层结构开始学习FPGA----FIFO IP的定制与测试
Informatics Orsay Ibn YBT 1172: find the factorial of n within 10000 | 1.6 14: find the factorial of n within 10000
Taro2.* applet configuration sharing wechat circle of friends
LeetCode:1175. 质数排列
golang中的Mutex原理解析
Meet in the middle
![[Niuke] b-complete square](/img/bd/0812b4fb1c4f6217ad5a0f3f3b8d5e.png)




![[Niuke] [noip2015] jumping stone](/img/9f/b48f3c504e511e79935a481b15045e.png)



