mirror of
https://github.com/hanzoai/migrate.git
synced 2026-09-30 22:55:10 +00:00
As reported in #835 go vet reporting the violation of naming convention of go test. see: https://pkg.go.dev/testing#hdr-Examples Although this project use golangci-lint as linter and it has functionality to skip by nolint:govet, so basically there is no problems. However if there is no cons, it is better to conform with naming convention and fix the code like below. https://github.com/golang-migrate/migrate/blob/bc74a7acab43c182563b62cc6dbcf06e5f2cb6d2/dktesting/example_test.go#L17
23 lines
475 B
Go
23 lines
475 B
Go
package testing
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func ExampleParallelTest() {
|
|
t := &testing.T{} // Should actually be used in a Test
|
|
|
|
var isReady = func(i Instance) bool {
|
|
// Return true if Instance is ready to run tests.
|
|
// Don't block here though.
|
|
return true
|
|
}
|
|
|
|
// t is *testing.T coming from parent Test(t *testing.T)
|
|
ParallelTest(t, []Version{{Image: "docker_image:9.6"}}, isReady,
|
|
func(t *testing.T, i Instance) {
|
|
// Run your test/s ...
|
|
t.Fatal("...")
|
|
})
|
|
}
|