如何在Windows系统上测试App Engine项目?

huangapple go评论71阅读模式
英文:

How to test App Engine project on Windows system?

问题

标准方式:goapp test - 无法工作。

输出:

D:\Projects\MyProject>goapp test
无法加载包:在 D:\Projects\MyProject 中没有可构建的 Go 源文件。
英文:

Standart way: goapp test — doesn't work.

Output:

D:\Projects\MyProject>goapp test
can't load package: package .: no buildable Go source files in D:\Projects\MyProject

答案1

得分: 1

goapp test命令会在当前目录中查找*_test.go文件,如果你没有指定包作为参数。

所以你可以选择:

  • 导航到你想要测试的包目录,该目录包含XX_test.go文件,然后执行goapp test命令。
  • 或者保持在你的项目文件夹中,并将包目录作为参数传递,像这样:
    goapp test ./my/package

了解更多关于Go的本地单元测试

英文:

goapp test looks for *_test.go files in the current directory if you don't specify the packages as parameters.

So either:

  • navigate to the package directory which you want to test and which contains the XX_test.go files then execute the goapp test command
  • or stay in your project folder and pass the package folder as parameter like this:
    goapp test ./my/package

Read more about Local Unit Testing for Go.

huangapple
  • 本文由 发表于 2015年2月11日 17:54:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/28451266.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定