fix: closure variable in loop

This commit is contained in:
崔竞宁
2023-09-19 21:05:21 +08:00
parent b094d98c63
commit fe43945e33

View File

@@ -99,6 +99,8 @@ func (c *Copyer) write(ctx context.Context, job *writeJob, ch chan<- *baseJob, c
var readErr error
for _, target := range job.targets {
target := target
dev := c.getDevice(target)
if badDsts.Contains(dev) {
job.fail(target, fmt.Errorf("bad target path"))