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

相关推荐
XMYX-013 小时前
37 - Go env 环境变量:配置管理与运行时控制
开发语言·golang
姚不倒19 小时前
Go 进阶实战:实现泛型数据验证器
云原生·golang
XMYX-021 小时前
36 - Go exec 执行命令
开发语言·golang
lolo大魔王21 小时前
Go 语言 HTTP 协议与 RESTful API 实训全解(理论 + 实战 + 规范)
http·golang·restful
一只小逸白21 小时前
LeetCode Go 常用函数速查表
linux·leetcode·golang
LCG元21 小时前
【Go后端开发】从 0 到生产级:高性能分布式网关全实现 + 接口限流熔断降级实战
分布式·golang·wpf
姚不倒1 天前
Go语言进阶:接口、错误处理与并发编程(goroutine/channel/context)
云原生·golang
宇明一不急2 天前
go 链表 (标准库实现)
开发语言·链表·golang
~|Bernard|2 天前
GO语言中哪些类型是可比较类型的(==和!=)
开发语言·后端·golang
比特森林探险记2 天前
底层数据结构分析 go 语言中的 slice map channel interface
数据结构·golang·哈希算法