diff --git a/dbus/config_test.go b/dbus/config_test.go index e28d4f7..0952019 100644 --- a/dbus/config_test.go +++ b/dbus/config_test.go @@ -13,7 +13,7 @@ import ( ) func TestConfig_Args(t *testing.T) { - for _, tc := range testCases() { + for _, tc := range makeTestCases() { if tc.wantErr { // args does not check for nulls continue @@ -30,7 +30,7 @@ func TestConfig_Args(t *testing.T) { } func TestNewConfigFromFile(t *testing.T) { - for _, tc := range testCases() { + for _, tc := range makeTestCases() { name := new(strings.Builder) name.WriteString("parse configuration file for application ") name.WriteString(tc.id) diff --git a/dbus/samples_test.go b/dbus/samples_test.go index 19d66b6..653a02f 100644 --- a/dbus/samples_test.go +++ b/dbus/samples_test.go @@ -145,7 +145,7 @@ var ( testCaseOnce sync.Once ) -func testCases() []dbusTestCase { +func makeTestCases() []dbusTestCase { testCaseOnce.Do(testCaseGenerate) return testCasesV }