treewide: initialize empty structs with var
Change-Id: I72d3993eaf5fe57c77b1dda8218e36a8cc11813d
Reviewed-on: https://review.monogon.dev/c/monogon/+/3108
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/pkg/event/etcd/etcd_test.go b/metropolis/pkg/event/etcd/etcd_test.go
index c6d50b1..bd96363 100644
--- a/metropolis/pkg/event/etcd/etcd_test.go
+++ b/metropolis/pkg/event/etcd/etcd_test.go
@@ -63,7 +63,7 @@
// it starts the watcher. This is used to test potential race conditions
// present between these two steps.
func setRaceWg[T any](w event.Watcher[T]) *sync.WaitGroup {
- wg := sync.WaitGroup{}
+ var wg sync.WaitGroup
w.(*watcher[T]).testRaceWG = &wg
return &wg
}
@@ -72,7 +72,7 @@
// thie WG after an etcd watch channel is created. This is used in tests to
// ensure that the watcher is fully created before it is tested.
func setSetupWg[T any](w event.Watcher[T]) *sync.WaitGroup {
- wg := sync.WaitGroup{}
+ var wg sync.WaitGroup
w.(*watcher[T]).testSetupWG = &wg
return &wg
}