草庐IT

Zend_Test

全部标签

go - vendor 问题 : found packages text (doc. 去)和转换(examples_test.go)在我的 vendor

这个问题在这里已经有了答案:Error"can'tloadpackage:packagemy_prog:foundpackagesmy_progandmain"(3个答案)关闭4年前。我遇到了一些问题:enterimagedescriptionhere..\vendor\github.com\spf13\afero\util.go:28:2:在D:\golang\src\services\vendor中找到包文本(doc.go)和转换(examples_test.go)\golang.org\x\text\transform我该如何解决这个问题?谢谢。

GoSonar : how to generate go test -json > report. json

如何生成gotest-json>report.jsonGo语言版本:Go1.10.3SonarQube属性:sonar.go.tests.reportPaths=report.json官方Sonar文档->https://docs.sonarqube.org/display/PLUG/Unit+Tests+Results+Import生成文件.PHONY:testtest:@$(foreachpackage,$(packages),\gotest-coverprofile$(package)/cover.out-covermode=count$(package);).PHONY:cov

unit-testing - 安装go lang后无法运行go test程序

尝试运行用Go编写的测试时出现以下错误。我安装了Golang和dep。我是Go的新手,我不确定这里的问题是什么。有人可以帮助我吗?xxxx-dxxxx:testxxxx$gotest#_/Users/xxxx/dev/xxxx/test/xxxx/testapplication_cluster_test.go:10:2:cannotfindpackage"github.com/stretchr/testify/assert"inanyof:/usr/local/Cellar/go/1.10.3/libexec/src/github.com/stretchr/testify/assert

mongodb - 无法解析行 #126 : mongo. 数据库 = mongo_db_test

我正在学习本教程Golang+Revelwebframework+MongodbRESTFulgeneratorfor(revel_mgo)一步一步来,但是当我最终结束它并尝试运行它时,它抛出了这个错误CRIT16:11:18revel_container.go:139:无法加载配置文件error="C:\Users\Userx\go\src\RevelApp\conf\app.conf:无法解析第126行:mongo.database=RevelApp"第126行是这样的:[dev]126-mongo.database=mongo_db_test127-mongo.path=127.

go - 为特定包运行 go test

我使用以下命令对特定包运行测试去测试fts-runrun_test.gocan'tloadpackage:packagefts:cannotfindpackage"fts"inanyof:/usr/local/Cellar/go/1.11.1/libexec/src/integration(from$GOROOT)/Users/i055555/go/src/fts(from$GOPATH)包裹看起来像gitproj/|----fts|-----command|-----run.go|-----run_test.go|----internal|-----fs.go|-----tb.go|

go - "go test"和 "bazel test"中的不同文件权限错误

如果一个测试想要断言文件权限错误,例如,写入文件系统的根目录,“gotest”返回一个syscall.EACCES错误,而“bazeltest”返回一个系统调用.EPERM。如何让“bazeltest”和“gotest”都通过测试?可以找到一个例子here. 最佳答案 您可以使用bazel--spawn_strategy=standalonetest//...禁用沙箱。我怀疑这会解决这个问题。但是,您可能需要考虑写入/是否是您要测试的行为。如果您需要在不同的操作系统或Docker容器内运行代码,在这种情况下您将获得不同的行为,因此您

Go test <function> 返回 undefined : <function>

尝试运行“gotestsum_test.go”返回错误:./sum_test.go:18:13:未定义:SumInt8FAIL命令行参数[构建失败]我正在学习golang入门类(class)。我们的老师分发了一个代码文件sum.go和一个测试文件sum_test.go。尝试在sum_test.go上运行“gotest”会返回上述错误。代码在我们老师的mac上运行良好,但他在重现问题时遇到了困难。这是我的环境设置:https://pastebin.com/HcuNVcAF求和packagesumfuncSumInt8(a,bint8)int8{returna+b}funcSumFloat

go - travis-ci在使用go test时需要root权限,如何设置?

我有Go测试文件,它需要root权限才能运行它(去测试)。Travisci中如何设置?这是yml:language:gosudo:requiredgo:-tipnotifications:email:on_success:changeon_failure:always在gitpush之后,travis-cibuild使用默认配置失败。 最佳答案 在travis中你可以使用sudo所以如果你想以root权限运行你的测试,改变脚本部分:script:sudo-Eenv"PATH=$PATH"gotest./...或者如果您使用的是Mak

go build 有效但 go test 没有

下面是我的项目结构:/user/home/go/src/github.com/my_go_proj/main.go/mypackage/service.go/service_test.goGOPATHpointsto/user/home/gocd/user/home/go/src/github.com/my_go_projgobuild--->Thisworksandcreatesthe`my_go_proj`executable.gotest?github.com/my_go_proj[notestfiles]gotestgithub.com/my_go_proj/mypackage

macos - 更新到 macOS beta 4 后,go test -cover 抛出 "fatal error: unexpected signal during runtime execution"

Gobuild和gotest仍然有效。在更新到macOSbeta之前,我使用测试覆盖工具没有遇到任何问题。“去测试”工作正常;但是,所有覆盖率测试命令都抛出此错误(gotest-coverprofile=coverage.out抛出相同的问题)。如果有人知道如何解决这个问题,我将不胜感激!$gotest-covergobuildgithub.com/hunteramericano/ErrorQuiver:/usr/local/Cellar/go/1.6.3/libexec/pkg/tool/darwin_amd64/cover:signal:fatalerror:unexpecteds