In my Google App Engine Go project, when I run goapp test
, I get the following errors:
runtime.main_main: main.main: not defined
runtime.main_main: undefined: main.main
Since it's a not a normal go app, but a Google App Engine one, it doesn't have a main.main(), so what do I need to do to get the tests running?
goapp test
without any parameters will run unit tests that are in the current / working directory.
So before running tests, navigate to the folder containing the *_test.go
files, then run goapp test
.
More about testing can be found here: Local Unit Testing for Go
And of course by running
goapp help test