internal/fetch: simplify logic

derrors.ToStatus handles nil as intended, so we can simplify the code.

Change-Id: Iae37f0bdbd42018a33fa11fb825e351280ea4ac5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/289669
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
diff --git a/internal/fetch/package.go b/internal/fetch/package.go
index 1c889a4..b694f86 100644
--- a/internal/fetch/package.go
+++ b/internal/fetch/package.go
@@ -10,7 +10,6 @@
 	"context"
 	"errors"
 	"fmt"
-	"net/http"
 	"path"
 	"runtime/debug"
 	"strings"
@@ -219,15 +218,11 @@
 			pkgs = append(pkgs, pkg)
 			pkgPath = pkg.path
 		}
-		code := http.StatusOK
-		if status != nil {
-			code = derrors.ToStatus(status)
-		}
 		packageVersionStates = append(packageVersionStates, &internal.PackageVersionState{
 			ModulePath:  modulePath,
 			PackagePath: pkgPath,
 			Version:     resolvedVersion,
-			Status:      code,
+			Status:      derrors.ToStatus(status),
 			Error:       errMsg,
 		})
 	}