How to run the specific test in golang
Simple answer:
go test -run <TEST_NAME>
Long answer
Keep in mind, that go test -run
takes a regexp as a parameter.
It means that if you have several two tests: TEST_NAME and TEST_NAME_2. If you want to run only TEST_NAME, you should run
go test -run=^TEST_NAME$
If your tests are in the other folder, provide a path to that folder
go test -run <TEST NAME> path/to/package
P.S.
Use -v
for verbose
More info read doc Testing_flags