![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go语言教程
文章平均质量分 83
x7813180
这个作者很懒,什么都没留下…
展开
-
golang 中string和int类型相互转换
总结了golang中字符串和各种int类型之间的相互转换方式: string转成int: int, err := strconv.Atoi(string) string转成int64: int64, err := strconv.ParseInt(string, 10, 64) int转成string: string := strconv.Itoa(int) int64转成string:...原创 2019-12-23 12:42:02 · 337 阅读 · 0 评论 -
go语言 time标准库 时间/时间戳操作
import ( "fmt" "time" ) 01: 获取当前时间 dateTime := time.Now() fmt.Println(dateTime) 02: 获取年 月 日 时 分 秒 纳秒 year := time.Now().Year() //年 fmt.Println(year) month := time.Now().Month() //月 fmt....原创 2019-12-20 15:59:41 · 1017 阅读 · 0 评论 -
golang 环境配置
1、安装Go 1.13或升级到Go 1.13 2、配置环境变量 #修改 GOBIN 路径(可选) go env -w GOBIN=$HOME/bin #打开 Go modules go env -w GO111MODULE=on #设置 GOPROXY go env -w GOPROXY=https://goproxy.cn,direct GO111MODULE: 这个环境变量主要是...原创 2019-12-19 15:17:50 · 929 阅读 · 0 评论