Closed Ewg-sha closed 6 years ago
Please report any further issues on the official tracker: https://youtrack.jetbrains.com/issues/Go, this is not to be used anymore.
However, to answer your question for now: You need to create the run configuration to use the package instead of a single file. To do so, go to Run | Edit Configuration | Go Application | <name of your configuration> | Run
kind and select Package
instead of File
then the IDE will complete automatically the first part of the package in the field, for example github.com/dlsniper/demo
and then you can add the rest of the package path as needed.
Plugin version (or commit hash): 173.4381.1
IDE name and version: IntelliJ IDEA 2017.3.3 (Ultimate edition)
Java version: 1.8.0_152-release-1024-b11 amd64
OS name and version: Redhat
What are you trying to do? run go test
What would you expect to happen? successful rnu
What happens? Compilation error
Your issue description goes here. Please be as detailed as possible
The problem is in the way how IntelliJ tries to run compiler. It compiles single file instead of compiling the whole package (folder): OROOT=/go #gosetup
GOPATH=/build/private/bgospace/pkg1:/build/private/bgospace/Go3p-Ginkgo-Gomega:/build/private/bgospace/Go3p-Github-Fortytw2-Leaktest:/build/private/bgospace/Go3p-Github-Gogo-Protobuf:/build/private/bgospace/Go3p-Github-Golang-Protobuf:/build/private/bgospace/pkg2:/build/private/bgospace/Go3p-Github-Grpc-GrpcGo:/build/private/bgospace/Go3p-Github-Pkg-Errors:/build/private/bgospace/Go3p-Github-Stretchr-Testify:/build/private/bgospace/Go3p-Golang-X-Crypto:/build/private/bgospace/Go3p-Golang-X-Net:/build/private/bgospace/Go3p-Golang-X-Sync:/build/private/bgospace/Go3p-Golang-X-Text:/build/private/bgospace/Go3p-Gopkg-Check:/build/private/bgospace/Go3p-Gopkg-Yaml:/build:/build/private/bgospace/pkg3 #gosetup