首页 > 解决方案 > 在使用 go 模块的 GOPATH 之外的项目中运行 godog 时出现错误“无法编译 testmain 包”

问题描述

使用 godog 我能够成功运行功能文件。现在,当我使用“go mod init mytest.com/automation”创建模块时;并尝试使用 godog 运行功能文件得到以下错误:

无法编译 testmain 包:退出状态 2 - 输出:C:\Users\\AppData\Local\Temp\go-build685806736\b001_testmain.go:5:2:找不到导入:“mytest.com/automation/C_ /Users//sample_automation_golang/src/features"

我看到过去报告过类似的问题,但现在标记为已解决:https ://github.com/DATA-DOG/godog/issues/136

有人可以帮助解决这个错误吗?

标签: goautomated-testscucumber

解决方案


推荐阅读