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

相关推荐
o0o_-_11 小时前
【go/gopls/mcp】官方gopls内置mcp server使用
开发语言·后端·golang
又菜又爱玩呜呜呜~1 天前
go使用反射获取http.Request参数到结构体
开发语言·http·golang
希望20171 天前
Golang | http/server & Gin框架简述
http·golang·gin
NG WING YIN2 天前
Golang關於信件的
开发语言·深度学习·golang
silver98862 天前
再谈golang的sql链接dsn
mysql·golang
刘媚-海外2 天前
Go语言开发AI应用
开发语言·人工智能·golang·go
deepwater_zone2 天前
Go语言核心技术
后端·golang
二哈不在线2 天前
代码随想录二刷之“动态规划”~GO
算法·golang·动态规划