go test configuration help
已完成
I have a project structured as follows:
.
├── README.md
├── cmd
│ ├── dup
│ │ └── main.go
│ └── echo
│ └── main.go
├── go.mod
├── internal
│ ├── dup
│ │ ├── dup1.go
│ │ └── dup1_test.go
│ └── echo
│ ├── echo1.go
│ ├── echo1_test.go
I configured go test with type=Directory, and the Directory and Working Directory being the root of
the project. I had expected that it would recurse the directories looking for the *_test.go files,
but instead I just get the following message: `can't load package: package .: no Go files in...`
The documentation I have read demonstrates pretty simple projects - so I would appreciate help/pointers how to configure testing for a more complex project structure.
请先登录再写评论。
I solved the test issue - after a lot of digging around I found the `go test -v ./...` which does traverse the directories looking for the test cases.
Hello,
The message can't load package: package .: no Go files in... comes from Go itself.
You can create a configuration by using a Right-click | Run | go test <dir name> in the GoLand. Everything should work.
Should you have any questions, please feel free to let me know.