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

相关推荐
FfHUCisI4 小时前
Golang Map 哈希表实现
golang·哈希算法·散列表
源代码•宸5 小时前
前置准备:定时微服务背景和现状
开发语言·经验分享·后端·微服务·云原生·架构·golang
李燚7 小时前
把规则搬回家:三个 BC 的贫血→充血重构实录(第103篇)
golang·agent·ddd·领域驱动设计·eino·deepflux·eino adk
astronautyi9 小时前
Go 运行时内存分配与 GC 位图深度剖析
开发语言·后端·golang
techdashen9 小时前
Go 中如何处理错误
开发语言·后端·golang
FfHUCisI10 小时前
Golang 切片扩容策略
开发语言·数据库·golang
名字还没想好☜10 小时前
Go 1.21 context.WithoutCancel 实战:父 context 取消了,收尾任务还要继续跑
开发语言·后端·golang·go
名字还没想好☜14 小时前
Go 用 -race 抓数据竞争:一个偶发崩溃的排查、原理与修复
开发语言·后端·golang·go
专注仿真14 小时前
Go操作Kubernetes API
贪心算法·golang·kubernetes
xcLeigh1 天前
Go入门:整数类型的溢出与安全边界
java·安全·golang