版本没有强要求,go1.22.5 版本可以正常编译运行。新建一个文件夹,用于存放 pg2mysql 工具源码:
假如接纳手册中的方法go get github.com/pivotal-cf/pg2mysql/cmd/pg2mysql进入 pg2mysql 源码文件夹后,可以看到以下文件:
会报错:
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
是由于目前新版本 Go 语言在模块(module)相关的使用方式上有了变革,直接先拉取源码在使用。
这里有 error 不要紧,看源码可知 log.Fatalf("error: %s", err) 会带有一个error,并不是无法使用。pg2mysql 使用
欢迎光临 IT评测·应用市场-qidao123.com (https://dis.qidao123.com/) | Powered by Discuz! X3.4 |