usage: go mod init [module-path]

用法:go mod init[模块路径]

Init initializes and writes a new go.mod file in the current directory, in

Init初始化并写入一个新的go。当前目录中的mod文件,在

effect creating a new module rooted at the current directory. The go.mod file

在当前目录下创建新模块的效果。开始吧。mod文件

must not already exist.

不能已经存在。

Init accepts one optional argument, the module path for the new module. If the

Init接受一个可选参数,即新模块的模块路径。如果

module path argument is omitted, init will attempt to infer the module path

忽略模块路径参数,init将尝试推断模块路径

using import comments in .go files, vendoring tool configuration files (like

在中使用导入注释。go文件、供应商工具配置文件(如

Gopkg.lock), and the current directory (if in GOPATH).

lock)和当前目录(如果在GOPATH中)。

If a configuration file for a vendoring tool is present, init will attempt to

如果存在供应商工具的配置文件,init将尝试

import module requirements from it.

从it导入模块需求。

See https://golang.org/ref/mod#go-mod-init for more about 'go mod init'.

看见https://golang.org/ref/mod#go-mod init了解有关“go mod init”的更多信息。

以上一段就是说执行命令时要写项目名称:如:

go mod init 项目名称