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

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

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.