Cannot run compiling on directory-kind run configurations

I can't tell if this: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000138284-GoLand-unable-to-debug-tests?input_string=Cannot%20run%20compiling%20on%20directory-kind%20run%20configurations was solved or abandoned or ignored.

I can't set breakpoints and debug a test configuration in GoLand, when using the `Directory` Test Kind

I tried both in the Go path and outside, I'm using latest go, and latest GoLand.

The run button works for the configuration but when I push the debug button, I get `Error running 'go test luhn': Cannot run compiling on directory-kind run configurations`

I can change Test Kind to File and specify all the files to be included in the test, and then debugging works. I can also make sure the code is located inside the GOPATH and use the `Packag` Test Kind. But is there a solution to be able to use `Directory` Test Kind outside the GOPATH when debugging a test run configuration?

2 comments
Comment actions Permalink
Official comment

> I can also make sure the code is located inside the GOPATH and use the `Packag` Test Kind. But is there a solution to be able to use `Directory` Test Kind outside the GOPATH when debugging a test run configuration?

You can use Go Modules and be outside of the GOPATH to use the Run Kind `Package`.
If you don't want to use GO Modules, but you also don't want to place your project inside GOPATH, then Run Kind `File` and adding all the files is what you need to do.

However, from the screenshot, I can see that you have a GOPATH structure, `/Users/yehudamakarov/go`.
But, inside it, I can see there's what looks like it could be a second GOPATH, `/Users/yehudamakarov/go/src/Exercism`.If you are trying to use Exercism lessons, please limit to a single GOPATH, e.g. `/Users/yehudamakarov/go` and place all the lessons under `/Users/yehudamakarov/go/src/Exercism/lessonName`.

Let me know if I can further help you with this.

Please sign in to leave a comment.