Check err that wasn't being checked
err was redeclared at the top of the if-statement
@@ -79,8 +79,10 @@ func (builder Builder) WithWorker(worker atc.Worker) SetupFunc {
return fmt.Errorf("team does not exist: %s", worker.Team)
}
- //lint:ignore SA4006 linter is wrong
w, err = team.SaveWorker(worker, 0)
+ if err != nil {
+ return err
+ }
} else {
w, err = builder.WorkerFactory.SaveWorker(worker, 0)
}
