Answer the question
In order to leave comments, you need to log in
Why doesn't it see the race package?
Hello everyone, I'm trying to test my project, but when I type it, I get the go test -v race
following error
. How can I fix this error?
Thank you.
Answer the question
In order to leave comments, you need to log in
If you installed according to the instructions from the site, then delete everything that was stuffed into the system. Then you need to install the compiler through the package manager.
For example, for debian/ubuntu via apt:
sudo apt install golang
Or via snap:
sudo snap install go --channel=1.16/stable --classic
What are you actually trying to do?
If you want to test something specific, then you need to use:
If a specific file:
But if you need to run tests with a check for RACE CONDITION, then this is completely different:
But you always need to specify what exactly to test, and it will not work to run tests simply by executing `go test` and run tests inside the application, most likely nothing will run.
go test packageName -run NameOfTest
go test foo_test.go
go test -v -race ./...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question