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

相关推荐
紧跟先前的步伐3 小时前
Go AI Agent 实战 28|Agent 的预算、超时与停止条件
开发语言·人工智能·后端·ai·golang
利威尔xu9 小时前
2026-11-05-Go内存管理面试
面试·golang
Zenova EdgeOS2 天前
Go 工业边缘错误处理实战:用 errors 构建可追溯错误链
开发语言·数据库·golang
JavaPub-rodert2 天前
从零搭建通用管理后台:ShiyuAdmin 的 Go、React 与 RBAC 实践
开发语言·react.js·golang
microrain2 天前
SagooIoT 的数据接入层只有四张表,却能接住三种外部数据
物联网·golang·数据建模·sagooiot
fly-iot2 天前
【FDE知识库】(4):企业知识库怎么选型,开源知识库分享几个,选择开源协议友好的版本,开发wiki-go项目
golang·开源·开源协议
福大大架构师每日一题2 天前
excelize v2.11.1发布:Go 1.26.0起步,16项安全修复与嵌入对象能力全面升级
开发语言·安全·golang
小小龙学IT2 天前
Go 语言 pprof 性能剖析与调优深度解析:把“卡在哪“变成一张可执行的数据图
开发语言·后端·golang
十二同学啊2 天前
Go 工程化详解:项目结构、代码规范、测试体系与 CI/CD 实践
ci/cd·golang·代码规范
利威尔xu3 天前
Go IM 源码实战(14):本地缓存快 3000 倍,失效却难 10 倍
后端·缓存·微服务·面试·golang