【报错】note: module requires Go 1.18

$ go run tableSize.go

github.com/go-sql-driver/mysql

/root/go/pkg/mod/github.com/go-sql-driver/mysql@v1.8.0/connector.go:45:18: undefined: strings.Cut

/root/go/pkg/mod/github.com/go-sql-driver/mysql@v1.8.0/dsn.go:441:24: undefined: strings.Cut

/root/go/pkg/mod/github.com/go-sql-driver/mysql@v1.8.0/dsn.go:529:18: cannot assign string to value in multiple assignment

/root/go/pkg/mod/github.com/go-sql-driver/mysql@v1.8.0/dsn.go:639:28: cannot assign string to cfg.Params[key] in multiple assignment

note: module requires Go 1.18

go get github.com/go-sql-driver/mysql@v1.7

go get: downgraded github.com/go-sql-driver/mysql v1.8.0 => v1.7.1

重新运行go脚本

相关推荐
参.商.5 小时前
【Day 27】121.买卖股票的最佳时机 122.买卖股票的最佳时机II
leetcode·golang
牛奔5 小时前
如何理解 Go 的调度模型,以及 G / M / P 各自的职责
开发语言·后端·golang
牛奔7 小时前
Go 是如何做抢占式调度的?
开发语言·后端·golang
清云随笔9 小时前
Golang基础
golang
牛奔12 小时前
Go 如何避免频繁抢占?
开发语言·后端·golang
不老刘16 小时前
LiveKit 本地部署全流程指南(含 HTTPS/WSS)
golang·实时音视频·livekit
Tony Bai1 天前
再见,丑陋的 container/heap!Go 泛型堆 heap/v2 提案解析
开发语言·后端·golang
念何架构之路1 天前
Go进阶之panic
开发语言·后端·golang
先跑起来再说1 天前
Git 入门到实战:一篇搞懂安装、命令、远程仓库与 IDEA 集成
ide·git·后端·elasticsearch·golang·intellij-idea
Tony Bai1 天前
“Go 2,请不要发生!”:如果 Go 变成了“缝合怪”,你还会爱它吗?
开发语言·后端·golang