【报错】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脚本

相关推荐
Hello.Reader6 小时前
Go-Elasticsearch v9 安装与版本兼容性
elasticsearch·golang·jenkins
五岁小孩7 小时前
实操使用 go pprof 对生产环境进行性能分析(问题定位及代码优化)
性能优化·golang·pprof
一杯科技拿铁12 小时前
Go 的时间包:理解单调时间与挂钟时间
开发语言·后端·golang
线程A12 小时前
Go 语言函数设计原则:避免修改传入参数
golang
猫头虎15 小时前
2025年02月11日 Go生态洞察:Go 1.24 发布亮点全面剖析
开发语言·后端·python·golang·go·beego·go1.19
Python涛哥18 小时前
go语言基础教程:【2】基础语法:基本数据类型(整形和浮点型)
android·开发语言·golang
ん贤19 小时前
GMP模型
运维·服务器·后端·golang
哈基咩19 小时前
Go语言unsafe包深度解析
服务器·开发语言·后端·golang
不过普通话一乙不改名1 天前
第一章:Go语言基础入门之函数
开发语言·后端·golang
whhhhhhhhhw1 天前
Go语言-fmt包中Print、Println与Printf的区别
开发语言·后端·golang