- 6
- 0
- 约2.76千字
- 约 2页
- 2023-06-16 发布于上海
- 举报
Golang数据类型转换
golang 数据类型
基本类型:boolean,numeric,string类型的命名实例是预先声明的。
复合类型:array,struct,指针,function,interface,slice,map,channel类型(可以使⽤type构造)。
数据类型转换表
// []byte - other type
[]byte = string : string([]byte)
[]byte = int : binary包处理, 查看下⾯
// int - other type
int = string : s = strconv.Itoa(i)
int = int32 : i32 = int32(num)
int = int64 : i64 = int64(num)
int64/int32 = int : i = int(num)
int64 = string : strconv.FormatInt(int64, 10)
int64 = time.Duration : time.Duration(int64)
i
您可能关注的文档
最近下载
- 孕产妇危重症紧急救治专家共识(2026年版).pptx VIP
- DB32/T 4786-2024 城镇供水服务质量标准.pdf VIP
- 量化基金校招笔试真题(含详细答案解析).docx VIP
- 2026年初中道德与法治教资全真试卷.docx VIP
- DELL厦门工业厂房施工组织设计(1).doc VIP
- WA6515塔吊性能说明书-WA6515-10B 操作手册.pdf VIP
- 2026年中国天麻市场运行动态监测及发展前景投资预测报告.docx
- 3.数据的价值课件 浙教版信息科技四年级上册.pptx
- 铁路线路防护栅栏(通线〔2023〕8001)上.pdf VIP
- 23G409 先张法预应力混凝土管桩.docx
原创力文档

文档评论(0)