更新时间:2023-11-17 18:30:22
请确保运行go mod init MODULE_NAME
(如果项目在GOROOT或GOPATH之外)或仅运行go mod init
(如果项目在GOROOT或GOPATH内) .该命令应在项目的根文件夹上运行.这将创建一个go.mod
文件,该文件将使go
能够解析您的软件包.
Make sure to run go mod init MODULE_NAME
(if the project is outside GOROOT or GOPATH) or just simply go mod init
(if the project is inside GOROOT or GOPATH). The command should be run on the root folder of your project. This would create a go.mod
file that would enable go
resolve your packages.