golang.org/x/mod/modfile.File.AddModuleStmt (method)

one use

	golang.org/x/mod/modfile (current package)
		rule.go#L95: func (f *File) AddModuleStmt(path string) error {