The go testing package provides the TB (testing.TB) interface which is an interface that provides a set of methods for writing test cases. One of the methods provided by the TB interface is Skipf() which can be used to skip a test case if a certain condition is met.
if !runIntegrationTests { t.Skipf("Skipping integration test") } // test code to be executed }
Here, we are using the flag package to parse command-line arguments. If the value of the first argument is not "integration", the test case will be skipped and the message "Skipping integration test" will be printed.
Package Library: "testing"
Golang TB.Skipf - 15 examples found. These are the top rated real world Golang examples of testing.TB.Skipf extracted from open source projects. You can rate examples to help us improve the quality of examples.