【报错】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/[email protected]/connector.go:45:18: undefined: strings.Cut

/root/go/pkg/mod/github.com/go-sql-driver/[email protected]/dsn.go:441:24: undefined: strings.Cut

/root/go/pkg/mod/github.com/go-sql-driver/[email protected]/dsn.go:529:18: cannot assign string to value in multiple assignment

/root/go/pkg/mod/github.com/go-sql-driver/[email protected]/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/[email protected]

go get: downgraded github.com/go-sql-driver/mysql v1.8.0 => v1.7.1

重新运行go脚本

相关推荐
阑梦清川2 小时前
关于Go语言的开发环境的搭建
开发语言·后端·golang
言之。2 小时前
Makefile 在 Go 项目中的实践
开发语言·elasticsearch·golang
Clown956 小时前
go-zero(十八)结合Elasticsearch实现高效数据检索
开发语言·elasticsearch·golang
IsPrisoner17 小时前
Go语言安装proto并且使用gRPC服务(2025最新WINDOWS系统)
开发语言·后端·golang
littleschemer17 小时前
Go基于plugin的热更新初体验
golang·plugin·热更新
言之。18 小时前
Go语言中的函数类型参数:深入理解`func()`
golang
我重来不说话21 小时前
免费Ollama大模型集成系统——Golang
golang·gin·ollama·免费大模型
Asus.Blogs21 小时前
为什么go语言中返回的指针类型,不需要用*取值(解引用),就可以直接赋值呢?
开发语言·后端·golang
林鸿群1 天前
go语言实现IP归属地查询
开发语言·golang·ip归属地