我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何将int转换为int64?

Im trying to convert an integer into an integer64 in go but im having no luck. Anyone know an easy way to do this?

This is called type conversion :

i := 23
var i64 int64
i64 = int64(i)
i := 23
i64 := int64(i)
fmt.Printf("%T %T", i, i64) // to print the data types of i and i64

This is probably obvious, but simplest:

i64 := int64(23)

近期文章

  • 使用反射,如何设置结构字段的值?
  • 在Go程序中捆绑静态资源的最佳方法是什么? [关闭]
  • Go的Emacs模式? [关闭]
  • 如何使用go get导入特定版本的软件包?
  • 在Golang中复制文件的简单方法
  • 范围引用代替值
  • 如何通过Map [string] int的值对其排序?
  • 在Golang中重用HTTP连接
  • 如何使用Go语言从另一个文件调用函数?
  • 如何从正在运行的Docker容器中读取文件和标准输出
  • 如何在Go中执行不区分大小写的正则表达式?
  • 遍历golang映射
  • 通过名称访问结构属性
  • 为什么我应该使用log.Println而不是fmt.Println?
  • 如何分析golang记忆?
  • 如何在不使用日志的情况下在Go中打印到Stderr
  • Golang中的Bcrypt密码哈希(与Node.js兼容)?
  • 如何实施Go渠道?
  • 从http.Request获取客户端IP地址的正确方法
  • 在Go中创建2D切片的简洁方法是什么?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华