internal/worker: use errors.Join in cleanup

Change-Id: I0674409a51de1b42c7437ad1ac4733e0cd3788a9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite-metrics/+/479235
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Maceo Thompson <maceothompson@google.com>
diff --git a/internal/worker/scan.go b/internal/worker/scan.go
index 6501c73..1a4847a 100644
--- a/internal/worker/scan.go
+++ b/internal/worker/scan.go
@@ -251,11 +251,5 @@
 // cleanup calls f and combines the error with errp.
 // It is meant to be deferred.
 func cleanup(errp *error, f func() error) {
-	if err := f(); err != nil {
-		if *errp == nil {
-			*errp = err
-		} else {
-			*errp = fmt.Errorf("cleanup: %v, and also %w", err, *errp)
-		}
-	}
+	*errp = errors.Join(*errp, f())
 }