[botanist] Fix goroutine bug
This ensures that the right device is captured.
Change-Id: I8fd11e2b4daf3ab1b784276946b23fd69fead2c0
diff --git a/cmd/botanist/zedboot.go b/cmd/botanist/zedboot.go
index 748fb87..13de934 100644
--- a/cmd/botanist/zedboot.go
+++ b/cmd/botanist/zedboot.go
@@ -226,11 +226,11 @@
errs := make(chan error)
for _, device := range devices {
- go func() {
+ go func(device *target.DeviceTarget) {
if err := device.Start(ctx, imgs, cmdlineArgs); err != nil {
errs <- err
}
- }()
+ }(device)
}
go func() {
addr, err := devices[0].IPv6Addr()