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
相关推荐
花酒锄作田6 天前
Gin 框架中的规范响应格式设计与实现
golang·gin
郑州光合科技余经理6 天前
代码展示:PHP搭建海外版外卖系统源码解析
java·开发语言·前端·后端·系统架构·uni-app·php
feifeigo1236 天前
matlab画图工具
开发语言·matlab
dustcell.6 天前
haproxy七层代理
java·开发语言·前端
norlan_jame6 天前
C-PHY与D-PHY差异
c语言·开发语言
多恩Stone6 天前
【C++入门扫盲1】C++ 与 Python:类型、编译器/解释器与 CPU 的关系
开发语言·c++·人工智能·python·算法·3d·aigc
QQ4022054966 天前
Python+django+vue3预制菜半成品配菜平台
开发语言·python·django
遥遥江上月6 天前
Node.js + Stagehand + Python 部署
开发语言·python·node.js
m0_531237176 天前
C语言-数组练习进阶
c语言·开发语言·算法
Railshiqian6 天前
给android源码下的模拟器添加两个后排屏的修改
android·开发语言·javascript