I am using Goland. I have the following package:
which has the files:
main_test.go, a.go, and a_test.go
In main_test.go I have the init(), setUp(), tearDown() functions that a_test.go uses.
If I run from the Goland terminal with "go test *.go -v" it runs all my tests in a_test.go with the init(), setup(), and teardown() being called accordingly. So this works just fine.
How can I run this using Goland's run configuration? I have it set up as "Go Test" with the following:
Test framework: gotest
Test kind: Directory (where I have the src/event), and I've tried File (where I've tried main_test.go and *.go)
working directory: src/events
If I try to run with Directory it tells me that it can't load package: named files must be .go files: ./...
If I try to run with File and set the file to main_test.go I get: "no tests to run"
If I try to run with File and set the file to a_test.go I get an error because the global variables found in main_test.go are not being found.
If I try to run with File and set the file to *.go I can't even save the configuration because the file *.go isn't found.
I can run this from the terminal so I'm sure there is a way to run this through the run configuration. I can't run in debug mode until I solve this.