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
相关推荐
小羊没烦恼!3 天前
初探性能优化——2个月到4小时的性能提升
java·开发语言·windows·算法·c#
伞伞悦读3 天前
【第38期】Python 模块与包详解:import、from、模块搜索路径、包结构和 __init__
开发语言·python
ttwuai3 天前
Go开源后台管理系统推荐:怎么按技术栈和边界比较4个官方仓库?
golang·gin
C语言小火车3 天前
C/C++ 为什么需要编译器?
开发语言·c++
codeejun3 天前
每日一Go·MySQL-5、锁机制全解析
云原生·golang
霍霍的袁3 天前
【C++】map 和 set 的使用 | 从用法到底层
开发语言·c++·学习·visual studio
孙启超3 天前
【AI开发之Rust】第 11 课:智能指针与内部可变性
开发语言·后端·rust
此生决int3 天前
深入理解C++系列(20)——C++11(下)
开发语言·c++
Achou.Wang3 天前
k8s中nginx worker process自动设置
后端·golang
CoderYanger3 天前
A.每日一题:835. 图像重叠
java·开发语言·程序人生·leetcode·面试·职场和发展·学习方法