go 数据类型转换

graph TD A[整型
int, int8, int16, int32, int64] -->|类型转换| B[浮点型
float32, float64] B -->|类型转换| A A -->|类型转换| C[布尔型
bool] C -->|类型转换| A B -->|类型转换| D[复数型
complex64, complex128] D -->|类型转换| B A -->|strconv.Itoa| E[字符串
string] E -->|strconv.Atoi
strconv.ParseInt| A B -->|strconv.FormatFloat| E E -->|strconv.ParseFloat| B C -->|strconv.FormatBool| E E -->|strconv.ParseBool| C A -->|类型转换| F[字节型
byte, rune] F -->|类型转换| A E -->|UTF-8 编码
strings.Bytes| F F -->|UTF-8 解码
string| E G[其他类型
slice, array, map, struct, pointer] -->|接口或类型断言| H[通过接口或类型断言] H -->|接口或类型断言| G A -->|类型转换| G B -->|类型转换| G C -->|类型转换| G D -->|类型转换| G E -->|类型转换| G F -->|类型转换| G subgraph strconv包 A -->|strconv.Atoi
strconv.ParseInt| E E -->|strconv.Itoa
strconv.FormatInt| A B -->|strconv.FormatFloat| E E -->|strconv.ParseFloat| B C -->|strconv.FormatBool| E E -->|strconv.ParseBool| C end subgraph 字符串与字节型 E -->|strings.Bytes| F F -->|string| E end style A fill:#f9f,stroke:#333,stroke-width:2px style B fill:#ccf,stroke:#333,stroke-width:2px style C fill:#cfc,stroke:#333,stroke-width:2px style D fill:#ccf,stroke:#333,stroke-width:2px style E fill:#fcf,stroke:#333,stroke-width:2px style F fill:#f9f,stroke:#333,stroke-width:2px style G fill:#f9f,stroke:#333,stroke-width:2px style H fill:#f9f,stroke:#333,stroke-width:2px end
相关推荐
苦学编程的谢11 分钟前
MyBatis_3
java·开发语言·后端·mybatis
go54631584651 小时前
Python点阵字生成与优化:从基础实现到高级渲染技术
开发语言·人工智能·python·深度学习·分类·数据挖掘
猫头虎1 小时前
2025年02月11日 Go生态洞察:Go 1.24 发布亮点全面剖析
开发语言·后端·python·golang·go·beego·go1.19
仰望天空—永强1 小时前
PS 2025【七月最新v26.5】PS铺软件安装|最新版|附带安装文件|详细安装说明|附PS插件
开发语言·图像处理·python·图形渲染·photoshop
寒士obj1 小时前
JVM 内存结构
java·开发语言·jvm
MediaTea1 小时前
Python 库手册:xmlrpc.client 与 xmlrpc.server 模块
开发语言·python
悦悦子a啊1 小时前
Python之--字典
开发语言·python·学习
float_六七2 小时前
JavaScript:现代Web开发的核心动力
开发语言·前端·javascript
一车小面包2 小时前
Python高级入门Day6
开发语言·python
祁同伟.2 小时前
【C++】类和对象(中)构造函数、析构函数
开发语言·c++