go 数据类型转换

graph TD A[整型<br>int, int8, int16, int32, int64] -->|类型转换| B[浮点型<br>float32, float64] B -->|类型转换| A A -->|类型转换| C[布尔型<br>bool] C -->|类型转换| A B -->|类型转换| D[复数型<br>complex64, complex128] D -->|类型转换| B A -->|strconv.Itoa| E[字符串<br>string] E -->|strconv.Atoi<br>strconv.ParseInt| A B -->|strconv.FormatFloat| E E -->|strconv.ParseFloat| B C -->|strconv.FormatBool| E E -->|strconv.ParseBool| C A -->|类型转换| F[字节型<br>byte, rune] F -->|类型转换| A E -->|UTF-8 编码<br>strings.Bytes| F F -->|UTF-8 解码<br>string| E G[其他类型<br>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<br>strconv.ParseInt| E E -->|strconv.Itoa<br>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
相关推荐
汤米粥38 分钟前
Python爬虫中Xpath用法之——normalize-space()
开发语言·python
科技道人1 小时前
记录 设置-显示大小和字体
开发语言·android设置·字体和显示大小
浮江雾1 小时前
Flutter第三节----Dart中的数据类型
android·开发语言·学习·flutter·入门·函数
weixin_422329311 小时前
AgentScope Java 项目入门 & Builder 深度解读
java·开发语言·人工智能
chh5631 小时前
C++--list
开发语言·数据结构·c++·学习·算法·list
Edward111111112 小时前
一AI名词
java·开发语言·数据库·学习
大侠锅锅2 小时前
第 9 篇:状态机实践——状态环 + 步进表替代 if-else 地狱
golang·边缘计算·状态机
aaPIXa6222 小时前
C++ 移动语义、完美转发与引用折叠详解
java·开发语言·c++
栈溢出了2 小时前
Redis repl_backlog 学习笔记
java·开发语言·redis·学习
urkay-2 小时前
Kotlin Flow分类
android·开发语言·kotlin